The "contains()" function only works with plain text matches, it doesn't support regular expression syntax.
You want to use the "testregex()" function. Also you need to escape the "$" in the regex by putting a backslash before it as "$" has a special meaning in regular expressions, signifying the "end of the text".
Here's an example:
{token="B$_ABC123"}
{if: testregex(token, "B\$_(.+)")}
{=token}
{else}Oh no! It looks like the token isn't valid.
{endif}
Heya Scott, I’ve been using this bit of code for a while and have run into a situation where I need to pass the resulting value on to use in other parts of the snippet. Is it possible to pass the result of this if statement into a urlload command?
Essentially filtering the contents of the clipboard to verify that it begins with B$_ and if not add it to the URL in the urlload.
Aha, my apologies! I forgot I modified the example to consider if the clipboard contents contain B$_ or not and then add it if not. Currently this is what I have.