tags:

views:

25

answers:

1

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 be appreciate it!

+1  A: 

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]+)\}/

Tim Cooper