Jump to content
UBot Underground

Recommended Posts

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 {
    }
}

Link to post
Share on other sites
  • Solution

you have 2 option
1.

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 {
    }
}
  • Like 1
Link to post
Share on other sites

 

you have 2 option

1.

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 :)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...