Regular expression for quoted string

If I have the following data:

"test1"."test2" AND "test1"."test2"

What regular expression can be used to match "test1"."test2"?

I tried the following but it did not work.

\b"test1"."test2"(\s+|$)

In this example, I would like to match "test1"."test2"and"test1"."test2"

0
source share
2 answers

\bmatches the word boundary, i. e. immediately before or after an alphanumeric character. Since "it is not alphanumeric (and assuming there is no word character in front of it), the statement fails - and therefore the entire regular expression.

Drop \b, remove the point, and you set.

+1
source

This should work

"test1"\."test2"
0
source

All Articles