开发者

php regex unlimited pattern

I'm looking to extend the regex below so I can have unlimited number of braces.

((?:{[0-9]:[a-z]+})?)

So my string can handle {1:foo}{2:bar}{3:more}

Any ideas will 开发者_JAVA技巧be appreciate it!


Which function are you using in PHP for matching the expression? Using preg_match_all should work for you with the follow regex: /\{([0-9]):([a-z]+)\}/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜