Regex whitespace word boundary

前端 未结 3 1002
醉梦人生
醉梦人生 2020-11-22 02:04

I have this expression

\\b[A-Za-z]+\\b

If I give abc@de mnop, it matches abc, de and mnop

3条回答
  •  清歌不尽
    2020-11-22 02:34

    \b means (?:(?. Which would match positions between letters and @.

    You can write:

    (?

    (?!\S) is equivalent to (?=\s|$).

提交回复
热议问题