I found this regex somewhere online that finds strings in my files that are likely presented to the user for a localization clean-up. However, I have a new task to find specific instances of two words and I thought I could use the same regex. I have tried several combinations but I’m just not good enough at regex to get it right.
Current regex for finding strings:
(?<=text=|label=|prompt=|toolTip=|title=|icon=|String=|Error=|Separator=|Symbol=)(("(?:\.|(\\\")|[^\""\n])*")|('(?:\.|(\\\')|[^\''\n])*'))
But now I want it to also capture if the words: catalog or in stock exist anywhere between the quotes.
Any help would be appreciated.
OK, this should do it, I believe:
All I did was add
\b(?:catalog|in stock)\bin the quote section. For example, for the double-quote section, it used to be this:I.e. any number of non-quote (unless escaped), non-return characters between double-quotes.
Now it is this:
Which is a double-quote, any number of legal characters as above, “catalog” or “in stock”, any number of more legal characters, and a quote.