Angus Leeming wrote: > The real problem being that the regex is insufficient for the use case? > > Looking at the code, there are three separate tests: > 1 "[,,,foo..." -> "[foo..." > 2 "foo,,,bar" -> "foo,bar" > 3 "...foo,,,]" -> ""...foo]" > it seems that your case should be caught by 1 above, no?
The brackets are removed, too, so the tests are: 1 "[,,,foo..." -> "foo..." 2 "foo,,,bar" -> "foo,bar" 3 "...foo,,,]" -> ""...foo" "[,,,]" becomes "]" in step 1, is unchanged in step 2, and produces the warning message in step 3. I guess the brackets are removed because then trim() can be used in the end to strip whitespace. Should I alter the last regex instead? Georg