Pattern in lookbehind

后端 未结 3 1393
予麋鹿
予麋鹿 2021-01-22 07:22

My question is related with lookbehinds, I want to find all the first numbers after the word \"this\", I have the following data:

188282 this is an exam

3条回答
  •  不知归路
    2021-01-22 08:17

    It depends on your implementation of regex. You'll have to do some testing for sure.

    I know that some implementations don't like this:

    (?<=\d{1,5}) or (?<=\w*)

    But they will work fine with this:

    (?<=\d{5}) or (?<=\w{1000})

    In other words, no repetition or flexible lengths.

提交回复
热议问题