Re: regex
| From: | Sebastian | Date: | Wed, 04 May 2005 22:07:54 +0000 |
| Subject: | Re: regex | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-214463@lists.php.net to get a copy of this message | ||
i partly solved the problem using this regex:
$tutorial['pagetext'] =
preg_replace_callback('#\[img\]\s*(\d+)\s*\[/img\]#siU',
'image_code_callback', $content['pagetext']);
except instead of using [img]foo[/img] i would like to do just [img=foo]
any help?
Sebastian wrote:
> very new to regex
>
> i have a string with "bbcode" such as [img=XXX]
> (XXX being numeric)
>
> how do i search the string for the value of the bbcode and compare it to
> another variable?
> so i can take XXX and compare it to $image dynamically.