match the same unknown character multiple times

后端 未结 4 1957
小蘑菇
小蘑菇 2021-01-01 21:41

I have a regex problem I can\'t seem to solve. I actually don\'t know if regex can do this, but I need to match a range of characters n times at the end of a pattern. eg. bl

4条回答
  •  忘掉有多难
    2021-01-01 22:02

    blahblah(.)\1*\b should work in nearly all language flavors. (.) captures one of anything, then \1* matches that (the first match) any number of times.

提交回复
热议问题