Posted by BKDotCom on 10/30/06 04:28
I had a similar RE problem and never figured it out, or found an
answer. I basically ended up using two callbacks..or doing the 2nd
check (does it contain "x") in the first callback
Capture and send all name values to the first (whether or not they
contain the {)
check whether or not the name value contains "{" inside that
cendrizzi wrote:
> I have no idea where to get help on RE stuff. Since it's for a PHP app
> I thought I would ask here to see if there was some RE pros. Basically
> I'm doing some template stuff and I wanted to use a
> preg_replace_callback function to call another function when the
> criteria of the RE expression is matched but have no idea how to
> accomplish it.
>
> So I start with this:
> /<(input|select|textarea)[^>]*name\s*\=\s*\"[_a-zA-Z0-9\s]*\"[^>]*>/
>
> but need to modify it so it only matches if it has '{' characters in
> the name but to not match if it does not.
>
> So this would not match:
> <input name="test">
>
> But this would match:
> <input name="test{0}">
>
> Thanks much in advance.
Navigation:
[Reply to this message]
|