LCB: Error: illegal escape in string

Peter TB Brett peter.brett at
Wed Feb 24 03:08:38 EST 2016

On 23/02/2016 21:59, Stephen MacLean wrote:
> Hi All,
> Working to build a library extension and I’m getting an error on this line when I go to test it in LCB:
> put "^[A-Z0-9._%+-]{1,64}@(?:[A-Z0-9-]{1,63}\.){1,125}[A-Z]{2,63}$" into tRegex
> The error is:
> illegal escape in string '^[A-Z0-9._%+-]{1,64}@(?:[A-Z0-9-]{1,63}\.){1,125}[A-Z]{2,63}$’

Hi Stephen,

In LiveCode Builder, quoted strings treat the '\' character as an escape 
character.  It's explained in the LiveCode Builder Language Reference guide.

So, you need to replace your '\' with '\\', and everything should work 
nicely for you.


Dr Peter Brett <peter.brett at>
LiveCode Open Source Team

LiveCode 2016 Conference

More information about the use-livecode mailing list