Regex to match a word with + (plus) signs

后端 未结 5 1472
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-04 01:46

I\'ve spent some time, but still have to solution. I need regular expression that is able to match a words with signs in it (like c++) in string.

I\'ve used /\

5条回答
  •  旧巷少年郎
    2020-12-04 02:05

    Plus sign have special meaning so you will have to escape it with \. The same rule applies to these characters: \, *, +, ?, |, {, [, (,), ^, $,., #, and white space

    UPDATE: the problem was with \b sequence

提交回复
热议问题