RegEx - Match Numbers of Variable Length

前端 未结 4 1900
小蘑菇
小蘑菇 2020-11-29 20:03

I\'m trying to parse a document that has reference numbers littered throughout it.

Text text text {4:2} more incredible text {4:3} much later on {22

4条回答
  •  长情又很酷
    2020-11-29 20:47

    Try this:

    {[0-9]{1,3}:[0-9]{1,3}}
    

    The {1,3} means "match between 1 and 3 of the preceding characters".

提交回复
热议问题