I’m integrating with WhatsApp and need to parse a text message for a specific string. I’m looking for a text string that starts with the letters PRJ, however, this could be in various formats. For example it could come through as “PRJ123456” or “PRJ-1234” (the numbers are not always the same length).
Also, the text could come through as just the PRJ code, or it could come through inside of a paragraph of text (ie “Please use PRJ123456” or “Please use PRJ123456 to map to”)
Is the best way to accomplish this doing some sort of REGEX? If so, how would you write that to accommodate the different PRJ formats as well as the different lengths. I would imagine they would be surrounded by spaces if they’re in a paragraph, or its a standalone code.
But I totally feel you @esowers. I like to do things “on my own” too sometimes, or at least understand them better. So I just wanted to share a great resource to start learning RegEx, if you’re interested. Try regexone.com! And you can also use regex101.com to play around with them and test the RegExes before copying them to Make.
Just make sure to use the ECMAscript flavor in regex101 to ensure it works the same