Hello everyone, I have a question. I received a webhook that includes tagged notes that look like this: “@username text”. After receiving this, I send “@username” to Slack to tag that user. My question is, how do I filter only the instances of “@username” that contain the “@” symbol in the word?
The simplest solution that I can think of is using the IF node with a ‘string starts with’ condition. If that’s not robust enough, you could also use an IF node with a regex match to ensure the @ symbol is followed by a name. And one step further could be validating the usernames against a list of know ones - you could use a code node for that.
@bartv Hey, thank you for the reply. Don’t you think using ‘contains’ instead of ‘starts with’ would be more effective? For example, if my note looks like this: ‘test @username1 test @username2’, using ‘starts with’ would lead to a false result. Anyways, is there any Java code to extract a word that has ‘@’ in front? I think that would suit me well instead of validating a list of usernames in the next step.