I have a random generated text with quotation marks and inside it there has randomally generated words with numbers combined
This what i have done so far:
(?<!["])(")\w
https://regex101.com/r/aIXAnk/3
CodePudding user response:
If you do not want to use capturing groups, you can do this:
(?<=["])\w ?(?=["])
It matches a string with a double quote in front of it and a quote behind it.
Also, it's better to use the ?
to make it not match more than you want.
Please note that if you have 3 or more quotation marks it may return unexpected results.
The best way is to use capturing groups like that:
"(\w ?)"
and grab the content by capturing group 1.