Attempting to use extractregex to remove specific characters from copied text. We utilize a token modifier and would like to remove the "B$_" from a string in the clipboard that would look like "B$_Number". Just can't figure out how to identify the first three characters.
As an aside, for something like this "extractregex" maybe not always be the best solution. It's very powerful but also complex. Text Blaze has a number of simpler methods to manipulate text like "split()" which splits a string into a list based on some delimiter.
Hey there, I’m working on a similar problem to this but am having a little bit of an issue.
It seems that when this token is copied it often picks up a blank space at the end which breaks the url we’re inserting the result into. Do you know of a way to remove spaces if they are found on the clipboard or maybe out of the assembled url?
Would this not work when using {clipboard} in the extractregex?
I’m using {=extractregex({clipboard}, "B$_(.+)(\s+|$)")} and I still seem to get a space when I copy one at the end.
As a follow up, along with a space, sometimes users are selecting too much and grabbing a line break. I guess I can also just try to get people to be more careful in how they are copying these tokens.
I’m attempting to extract specific strings on a page with a couple of complexities. The strings I’m trying to display in my snippet are formatted like #TEAM_SUSP_DEVICE. Where the TEAM part varies. The trouble is that a page may have more than one note that begins with a # and the team being variable can not be added to the search criteria. Is there a way to format regex to search for something that begins with # and ends with DEVICE? Then ideally I’d want to be able to pass that resulting note hash value into an if statement to direct the snippet if the note specified is present.
Thanks so much! I was completely overcomplicating things by loading the regex into it’s own value then building my if statement off of that.
What we did end up getting to work was (SUSP_.+?)(?:\s|")") but I think what you provided will be much more reliable. Thanks again! you’re a life saver!