Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
string in regular expression/
#1
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!
#2
Macro Macro1565
Code:
Copy      Help
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.
#3
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
#4
{{
#5
Thanks. I honestly thought I tried that. So obvious.
jim


Forum Jump:


Users browsing this thread: 1 Guest(s)