Regular expression escape characters

Dar Scott dsc at swcp.com
Thu Mar 29 02:15:05 EDT 2012


I don't think punctuation are word characters, so the \b might not be working right.  Try \!\!\! without the \b and see if that matches something.  If it does, then work on getting the boundary conditions right.  -- Dar

On Mar 28, 2012, at 9:19 PM, Bill Vlahos wrote:

> I am building a regular expression to find a set of question marks and exclamation points. For example ??? or !!!.
> 
> These are special characters so they mean something to a regular expression.
> 
> How do I find them in the text?
> 
> If I want to find a word such as "Bill" I can matchText with (\bBill\b) but I can't do (\b!!!\b) and if I do (\b???\b) I get an error.
> 
> I've looked on the web for escaping characters and they suggest using a slash before. However, when I try (\b\!\!\!\b) it doesn't work.
> 
> I've also found references to \Q…\E to have everything between a literal but (\b\Q!!!\E\b) doesn't work either.
> 
> Any ideas?
> 
> Bill Vlahos
> _________________
> InfoWallet (http://www.infowallet.com) is about keeping your important life information with you, accessible, and secure.
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

---------------------------
Dar Scott
dba 
Dar Scott Consulting
8637 Horacio Place NE
Albuquerque, NM 87111

Lab, home, office phone: +1 505 299 9497
For Skype and fax, please contact.
dsc at swcp.com

Computer Programming and tinkering,
often making LiveCode libraries and
externals, sometimes writing associated
microcontroller firmware.  
---------------------------






More information about the use-livecode mailing list