regex question

Associate
Joined
4 Mar 2007
Posts
315
Location
United Kingdom
So, I'm in the process of making a shortcode Object->Method->array-return parser. In the sense that it reads from a template file like so:

Code:
[#object:method@arrKey@arrKey2@arrKey3@...]

I've currently got [#object:method@arrKey] working if the return of the method is an array and:

Code:
[#object:method@]
if it isn't an array.

I'm using this regular expression...

PHP:
preg_match_all('"#.[a-zA-Z]*.:[a-zA-Z]*@[a-zA-Z]*"', $contents, $arr, PREG_PATTERN_ORDER);

So my question to you is, how would I manage to get it to allow up to 5x more @ after the first one like in the first example which uses 3 references.
 
Back
Top Bottom