java - android regex odd behavior -
what error following regular expression? working fine in java whereas android throws "pattern syntax exception".
"((?<==)+(\"[^\"]+\"|[^,=+<>#;\r\n]+))"
avinash raj pointed important mistake: +
multiplier after positive lookbehind expression.
using nested marking groups mistake. outer parentheses useless here , should removed reduce complexity.
and backslashes in strings must escaped backslashes. think \r
, \n
should passed regular expression engine , not characters code value 13 , 10, string use is
"(?<==)(\"[^\"]+\"|[^,=+<>#;\\r\\n]+)"
Comments
Post a Comment