I have a long string with some HTML data in which I need to find this pattern:
"AnyWord1 ... AnyWordN":"$SpecificWord"
There is must be any number of AnyWordN words, but after it is always only one word “$SpecificWord”
I tried
\".*\"\$SpecifcWord\"
but this only work, when there is no quotation mark symbols in data before first ” before “AnyWord”
So it works for this example: http://regexr.com?32kqh
But didn’t work if text before this pattern containt other quotation mark, like this: http://regexr.com?32kqk
I’m sure, that there is no " characters in text.
I don’t quite understand your question (what is “value1”, and what do you mean by
" symbol near value1?), but in general, your regex should be matching correctly, if the source code of the page you’re looking at really contains exactly this text.To cover a few corner cases, it might be worth making some parts of the regex more explicit:
might work better.
Another potential problem: Are you certain that you have actual
"characters in your string? Or might they be in fact"character entities?Please clarify your question.