Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

In a simple regex I want to match segments where "1 is not followed by 'a', possibly preceded by whitespaces", '1' may be followed by a nonword character (such as ",").

(在一个简单的正则表达式中,我要匹配以下段:“ 1后面不跟'a',可能后面跟空格”,'1'后面跟一个非单词字符(例如“,”)。)

1\W(?!\s a) functions correctly (on test strings "1 a" and "1, a") 1\W?(?!\s a) does not function correctly.

(1 \ W(?!\ s a)正常运行(在测试字符串“ 1 a”和“ 1,a”上)1 \ W?(?!\ s a)正常运行。)

What is the explanation for this?

(这有什么解释?)

  ask by TonyR translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
432 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...