Meaning of pound (#) in a regular expression

前端 未结 3 1064
野的像风
野的像风 2021-02-19 05:59

I have a regular expression with a pound # modifier.

What does \\# mean in a regular expression? What does the # mean in a regul

3条回答
  •  无人共我
    2021-02-19 06:27

    \# is not a valid regex modifier. It would technically be a way to escape a # character, IF the # meant anything significant in Java's regex. Because it doesn't, Java is just ignoring this invalidity and reading it as a # instead of throwing you an error.

提交回复
热议问题