How to get a regex to start from the beginning of a string

后端 未结 4 1006
心在旅途
心在旅途 2021-01-13 19:01

This is an oddball issue I\'ve encountered (and probably have seen before but never paid attention to).

Here\'s the gist of the code:

my $url = \'htt         


        
4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-13 19:35

    m//g does not reset the position. You need to do that manually. See this for reference: http://perldoc.perl.org/functions/pos.html

    I believe you just set pos to 0 or undef and it will work.

提交回复
热议问题