Using special characters with unparsed special characters

Can someone please tell me the correct syntax of how you do this.

I'm trying to do:

$regexp(%_filename%,'exp',$1 ()

I tried:

$regexp(%_filename%,'exp',$1 '(')

But it throws a syntax error.

I know the following two work:

$regexp(%_filename%,'exp',$1 a)
$regexp(%_filename%,'exp',a '(')

So you must just need some sort of different syntax when trying to mix parsed and unparsed special characters?

Thanks for any help.

You need to escape the ( character with a backslash - use ( instead.

Edit:
No - I'm wrong. That doesn't work.

Even stranger is that:

$regexp(%_filename%,(\d),$1')')         works but
$regexp(%_filename%,(\d),$1'(')         doesn't...

Regards,

gvm

You can use \x28 instead of (

Ah that works thanks.

Also not working is:

$regexp(%_filename%,(.*),$1\))

which outputs the filename with "\\)" appended (two backslashes). I could understand if it output no backslashes or one backslash, but why does it produce two backslashes?

gvm

It is confusing me a little, I don't think the syntax is properly correct here. But I have all the functionality I want now, so (although it goes against a lot of my principles as a programmer) I'm just going to ignore it all :slight_smile: