How to escape text for regular expression in Java

前端 未结 8 1994
我在风中等你
我在风中等你 2020-11-22 03:30

Does Java have a built-in way to escape arbitrary text so that it can be included in a regular expression? For example, if my users enter \"$5\", I\'d like to match that exa

8条回答
  •  情书的邮戳
    2020-11-22 03:48

    ^(Negation) symbol is used to match something that is not in the character group.

    This is the link to Regular Expressions

    Here is the image info about negation:

    Info about negation

提交回复
热议问题