I need a regex which matches any character that is not in the set of symbols (but only if this symbol doesn't follow a backslash)
Is there any one line solution?
sample input: "Test1\,test2,test3\<\>test4<>test5"
reqex to improve: /[^,<>]+/
I need a regex which matches any character that is not in the set of symbols (but only if this symbol doesn't follow a backslash)
Is there any one line solution?
sample input: "Test1\,test2,test3\<\>test4<>test5"
reqex to improve: /[^,<>]+/
Assuming \ is not at the first position of a match you may use this regex:
[^,<>\\]+(?:\\.[^,<>\\]*)*
RegEx Details:
[^,<>\\]+: Match 1 or more of any character that are not inside the the [...]\\. match any escaped characterIf \ can be at first position then you may use:
(?:\\.|[^,<>\\]+)+