[Pmwiki-users] Help with PHP regexp
John Feezell
johnfeezell
Thu Jan 8 19:12:17 CST 2004
Thanks, Christian, this is very helpful.
-JF
On Fri, 9 Jan 2004 02:06:41 +0100 (CET), Christian Ridderstr?m
<chr at home.se> wrote:
> On Mon, 5 Jan 2004, John Feezell wrote:
>
>> I recently began studying PHP regular expressions so that I could use
>> them with PmWiki and FTS. I have material from the PHP manual but would
>> like to know how others on the list have gained knowledge of these -
>> websites, books, etc..
>
> Try this tool on them:
>
> http://www.weitz.de/regex-coach/
>
> It can show a 'tree'-view of the regexp which is nice when you are
> drowning in parenthesis...
>
> However, remember that in a statement like this:
>
> re = "la bla\n";
>
> the last character in the string will not be 'n', since "\n" is
> translated... the regexps you see in pmwiki.php therefore have lots of
> double '\\' for every '\' ...
>
> To see what the strings really contain, open local.php and add this line
>
> $EnableDiag=1;
>
> then use the browser on a page with the action 'diag', i.e. like this:
>
> http://www.lyx.org/~chr/attachlist/pmwiki.php?action=diag
>
> that page will (among lots of other stuff) contain the actual regexps as
> they are recieved by preg_match() and others. This is what you copy'n
> paste into 'regex-coach'
>
> /Christian
>
--
More information about the pmwiki-users
mailing list