Java: Find everything in a string that's not a regex pattern

I have a series of regex patterns stored as strings and I'm looking to capture everything in each string that isn't made up of "special" regex characters.

For example, in the string .*/hello/(?[0-9]+)/blah, I'd like to be able to pick out /hello/ and /blah, as .* and (?[0-9]+)are both valid regex patterns.

An initial thought was to pull out everything not in brackets, but I can't assume that all regex patterns in my string will be grouped.

Does anyone know of a library or any existing solutions that would allow me to do...

Read More »

By: StackOverFlow - Thursday, 8 November

Related Posts