How does {m}{n} (“exactly n times” twice) work?

前端 未结 7 660
自闭症患者
自闭症患者 2021-02-03 16:23

So, some way or another (playing around), I found myself with a regex like \\d{1}{2}.

Logically, to me, it should mean:

(A digit exac

7条回答
  •  没有蜡笔的小新
    2021-02-03 17:11

    I am guessing that in definition of {} is something like "look back to find valid expression (excluding myself - {}", so in your example there is nothing between } and {.

    Anyway, if you wrap it in parenthesis it will work as you expected: http://refiddle.com/gv6.

提交回复
热议问题