[pmwiki-users] Regex question

Patrick R. Michaud pmichaud at pobox.com
Fri Jan 27 10:45:41 CST 2006


On Fri, Jan 27, 2006 at 03:51:06PM +0000, Hans wrote:
> I am looking for a markup to apply only to names (including digits
> and underscore) bracketed by single curly brackets like {word} or
> {Another_Word2}.
> I came up with this:   '/\{([\\w]+?)\}/'
> but i never seen the use of \w in pmwiki. Is there a  reason not to
> use \w ?

PmWiki uses \w quite a bit -- look through stdmarkup.php, or even 
pmwiki.php.

One of the things to be careful of is that on some systems \w will
only match ASCII letters and digits (i.e., [_0-9a-zA-Z]).  In particular,
it typically doesn't match many utf8 letters.

Pm




More information about the pmwiki-users mailing list