[pmwiki-users] brackets without space

Jens Schiffler jens.schiffler at gmx.de
Fri Jan 27 14:33:27 CST 2006


** Reply to message from JB <jbit at ev1.net> on Fri, 27 Jan 2006 14:09:21 -0600


> I need regular expression help.
> 
> Here is my current regular expression:
> 
>   /^\\[([^[].*?)\\]/


I assume the double backslash was inserted by your mailer.
How about this (the same as above but without the dot):

  /^\[([^[\]]*?)\]/

meaning: At line begin match a single "[" followed by a sequence of anything
but "[" or "]" and a closing "]"

another variant:

 /^\[([^[]?.*?)\]/


meaning: At line begin match a single "[" followed by zero or one "non ]",
followed by anything, followed by "]"


Jens




More information about the pmwiki-users mailing list