开发者

Regular Expression For Quoted String

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"


\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.


This should work

"test1"\."test2"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜