Pattern Matching with special characters
I am new to Intersystems Cache, so please bear with me. We are using HealthShare 2013.1.
I have a routine to compare databases from separate instances where I want to ignore values that begin with %sqlcq. I thought this would be easy with pattern matching operator '?' but it is proving difficult and it seems to be because of the percent character.
For example:
set x = "%sqlcq.something.value.foo"
#;does not evaluate as true.
if x?1P1"sqlcq" {write "valid"}
set y="sqlcq.something.value.bar"
if y?1"sqlcq".E {write "valid"}
valid
if x?1"sqlcq".E {write "valid"}
If the variable value does not include the leading percent character, then I can successfully match. If it does include the percent character then it fails.
I did try the following pattern, x?1P.1"sqlcq".E and I thought this was successful, but it ended up ignoring %SYS.FOO
What am I missing with pattern matching here?
Thank you.
Dan Lee
Amazing Charts | Harris Computer