Posts: 97
Threads: 48
Joined: Sep 2010
Hello,
Is it possible to use a, for example findrx, and the input of a string?
i mean something like this: findrx( input "a\d{6} here the input of another sting )
if so can you help me out on how to do this?
Thanks!
Posts: 12,061
Threads: 140
Joined: Dec 2002
Macro
Macro1565
str s1 s2
int i
s1="string1"
s2="string2"
i=findrx(s1 F"a\d{6}\Q{s2}\E")
out i
if(i<0) ret
The F makes possible to use variables in the string. In this case we use s2 enclosed in {}.
The \Q\E disables special regular expression characters in s2.
Posts: 1,000
Threads: 253
Joined: Feb 2008
In this example the {6} gets formatted as 6 in the search pattern.
I've had this problem before using the string F formatting where I need to have "{ }" as characters.
How do you escape them so they won't get formatted out or error?
Thanks,
Jim
Posts: 12,061
Threads: 140
Joined: Dec 2002
Posts: 1,000
Threads: 253
Joined: Feb 2008
Thanks. I honestly thought I tried that. So obvious.
jim