BigEfromDaBX 25 Posted November 29, 2016 Report Share Posted November 29, 2016 How do I use the $find regular expression with $contains. Both of them ask for the source text. Im not using the $find regular expression in the sample below but i would like to match fox or cat using the regex fox|cat. Thanks. set(#var,"the quick brown fox jumped over the lazy god.","Global") if($contains(#var,"fox|cat")) { then { alert("Match......") } else { } } Quote Link to post Share on other sites
Solution pash 504 Posted November 29, 2016 Solution Report Share Posted November 29, 2016 you have 2 option1. if($either($contains(#var,"fox"),$contains(#var,"cat"))) { then { alert("Match......") } else { } }2. if($comparison($find regular expression(#var,"(fox|cat)"),"!= Does not equal","")) { then { alert("Match......") } else { } } 1 Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted November 29, 2016 Report Share Posted November 29, 2016 comparison is the more stable of the two 1 Quote Link to post Share on other sites
BigEfromDaBX 25 Posted November 29, 2016 Author Report Share Posted November 29, 2016 you have 2 option1. if($either($contains(#var,"fox"),$contains(#var,"cat"))) { then { alert("Match......") } else { } }2. if($comparison($find regular expression(#var,"(fox|cat)"),"!= Does not equal","")) { then { alert("Match......") } else { } }@pash Thanks for the options. Will look at both Quote Link to post Share on other sites
BigEfromDaBX 25 Posted November 29, 2016 Author Report Share Posted November 29, 2016 comparison is the more stable of the two I definitely like the comparison one cuz I can use my regular expressions Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.