Why this regex assertion doesn't match?

前端 未结 1 670
我寻月下人不归
我寻月下人不归 2020-12-22 00:56

I\'m trying to just preg content between html tags, I\'m trying this simple assertion pattern and I don\'t understand why it doesn\'t match this string.

<         


        
相关标签:
1条回答
  • 2020-12-22 01:42

    Lookbehinds on debuggex (PCRE, Javascript and Python) cannot be of variable width, meaning that you can use (?<=<a>) which has a fixed width (3 characters) but not something that can vary in length (?<=<a.*>) (can have 3 characters, or 4, or 5, etc).

    The regex simply is not valid but debuggex tells you that there is no match.

    0 讨论(0)
提交回复
热议问题