LCB: Error: illegal escape in string

Stephen MacLean smaclean at madmansoft.com
Wed Feb 24 13:26:14 CET 2016


> On Feb 24, 2016, at 3:08 AM, Peter TB Brett <peter.brett at livecode.com> wrote:
> 
> 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.
> 
>                                            Peter
> 

Hi Peter,

Thanks for that, I will give it a try! 

Can you explain why it’s treated that way inside a quoted string? Just curious:)

Also, can you point me to the LCB Language Reference guide? Or is that what’s in the dictionary? I’d love to be able to dive into an actual reference!

Thanks!

Steve MacLean





More information about the use-livecode mailing list