[pmwiki-users] pattern matching:
Martin Fick
mogulguy at yahoo.com
Mon Dec 4 11:56:42 CST 2006
--- "Patrick R. Michaud" <pmichaud at pobox.com> wrote:
> On Sat, Dec 02, 2006 at 08:15:44PM -0500, The Editor
> wrote:
> > I'm working on a "special" project and trying to
> get this pattern
> > match to work and it almost works, but I seem to
> be having some
> > problems with :, -, and . in the [ ].
> >
> > preg_replace('|\{([\-\.A-Za-z0-9:_]+)\}|e',
> "Function($1)", $text);
> >
> > I'm trying to get this to match expressions like
> the following:
> >
> > {TEXT:Group.Name-36_End}
> >
> > Any help would be appreciated.
>
> Keep it simple:
>
> preg_replace('/\\{([-.:\\w]+)\\}/e',
> "Function('$1')", $text)
I think:
preg_replace('/\\{([_-.:\\w]+)\\}/e',
"Function('$1')", $text)
-Martin
____________________________________________________________________________________
Any questions? Get answers on any topic at www.Answers.yahoo.com. Try it now.
More information about the pmwiki-users
mailing list