Positive lookahead doesn't stop at first occurrence

后端 未结 1 345
我寻月下人不归
我寻月下人不归 2021-01-04 07:24

I use the regex

(?<=Charset:\\s).+(?=) 

on the following data (There is no newline char in the data, I made it look better

相关标签:
1条回答
  • 2021-01-04 07:51

    An easy way is to use the non-greedy operator.

    (?<=Charset:\s).+?(?=<br\/>)
    
    0 讨论(0)
提交回复
热议问题