Regex excluding specific characters

后端 未结 4 2191
你的背包
你的背包 2020-12-09 16:01

In this lesson I don\'t understand why [^b] is not correct? I understand that [^bog] is correct.

[^b] should match any string

4条回答
  •  时光取名叫无心
    2020-12-09 16:44

    [^b] will only match one character that is not 'b'.
    [^b]+ will specify that RegEx group to match one or more characters that are not 'b'.
    [^b]* will specify that RegEx group to match zero or more characters that are not 'b'.

提交回复
热议问题