What do ^ and $ mean in a regular expression?

后端 未结 2 829
野的像风
野的像风 2020-11-22 05:41

What is the difference between \"\\\\w+@\\\\w+[.]\\\\w+\" and \"^\\\\w+@\\\\w+[.]\\\\w+$\"? I have tried to google for it but no luck.

2条回答
  •  醉梦人生
    2020-11-22 06:27

    Try the Javadoc:

    http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html

    ^ and $ match the beginnings/endings of a line (without consuming them)

提交回复
热议问题