tags:

views:

34

answers:

2

If I have the following data:

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

What regex can I use to match "test1"."test2"?

I tried the following but it did not work.

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

In the given example I'd like to match "test1"."test2", and, "test1"."test2"

A: 

This should work

"test1"\."test2"
Gopi
+1  A: 

\b matches at a word boundary, i. e. just before or after an alphanumeric character. Since " is not alphanumeric (and assuming that there is no word character right before it), the assertion fails - and therefore the entire regex.

Drop the \b, escape the dot, and you're set.

Tim Pietzcker
Thanks, this works!
blackberryfan234