This is my input string:
, a. [the Cat.] Pertaining to the Cat.
This is my regular expression:
(?!^|,) means match the beginning of the string or a comma, negative lookahead
([\s,\S]*?) means match anything
[A-Z] means match a capital letter-- in this case, it was meant to capture 'P' from "Pertaining to..."
This is what I catch:
This is what I want to catch:
Some input strings, like the one above, have [some text in brackets] while some input strings do NOT.
If there is bracketed text in the string with a capital letter,
1) how do I prevent the capital letter in the brackets from matching the [A-Z], and
2) how do I not capture the bracketed text?
Thanks for the help!
View Complete Post