What are ^.* and .*$ in regular expressions?

后端 未结 7 1096
臣服心动
臣服心动 2021-02-03 23:05

Can someone explain the meaning of these characters. I\'ve looked them up but I don\'t seem to get it.

The whole regular expression is:

/^.*(?=.{8,})(?=.         


        
7条回答
  •  我在风中等你
    2021-02-03 23:50

    This matches the beginning of the line (^) followed by any character (.*) :

    ^.*
    

    This matches the end of the line ($) preceded by any character (.*) :

    .*$
    

提交回复
热议问题