<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Hi there,
I am having trouble forming a regex expression (in JMP 9) that will match any word except some words that are specified.
So for instance,
Say, I dont want to match "hello" or "goodbye", but everything else.
A search online suggests
<SPAN class="pun" style="font-size: 13.333333969116211px;">^((?!</SPAN><SPAN class="pln" style="font-size: 13.333333969116211px;">hello</SPAN><SPAN class="pun" style="font-size: 13.333333969116211px;">|</SPAN><SPAN class="pln" style="font-size: 13.333333969116211px;">goodbye</SPAN><SPAN class="pun" style="font-size: 13.333333969116211px;">).)*</SPAN><SPAN class="pln" style="font-size: 13.333333969116211px;">$s</SPAN>
but JSL doesn't seem to support this type of regular expression.
I don't want to use any outside functions to help in this process, I just want to use a regular expression to accomplish this task because it will be used within another regular expression that is more complex. Could anybody help me with this problem?
Thanks!
Michael
I don't do Regex but, depending on exactly what you want, the JSL functions Contains() and Substitute() can get you there.
str1="You say goodbye and I say hello, hello, hello.";
str2 = "I don't know why you say goodbye, I say hello, hello, hello.";
show((contains(str1, "Hello")) | contains(str1, "Goodbye"));
str3=substitute(substitute(str2, "hello", ""), "goodbye", "");
print(str3);
/*:
Contains(str1, "hello") | Contains(str1, "goodbye") = 1;
"I don't know why you say , I say , , ."