Hey, so am extracting a couple of info from an email using regex pattern, I am creating a different text parser for each pattern but only one shows up as output, anyone know why
If I understand your question correctly.
You can not call the same module from within itself.
Its output can be called only in the following module.
Are you using multiple extract groups in your patterns? You can even name them if you’d like. Show us your regex patterns please.
Hey, thanks for replying, so I am trying to extract details inside an email such as name, phone, email using regex patterns.
These are the patterns to extract each-
First Name- (?<=First Name\n).*
Last Name- (?<=Last Name\n).*
Email- (?<=Email\n)[^<]+
Phone- (?<=Phone\n)[^<]+
This is the input data in case you need them for reference
so I created a text parser for each of these regex patterns I mentioned and only one shows up when I use a “set multiple variable” module
Also, for some weird reason, the regex pattern is not picking the data although it picked when I tested the regex pattern in a site. Is it because of any setting I use in text parser?
You are using a positive lookbehind which isn’t supported in ECMAScript regex flavour used in Make. Neither positive nor negative lookbehind is supported in make. Only lookahead capture is allowed.
Use a capture group instead using plain old ()
Also test everything in regex101.com using the ecmascript flavour to ensure your regex will function as intended without any weird side effects or errors.
Hi Alex, I could have sworn I’ve used Positive Lookbehind in a Make Regex Match Pattern before, so I did a quick test. I have a very simple scenario with a Match Pattern module that searches for
(?<EmailAddress>(?<=Email).*)
The text I am searching within is
Email whatever@hotmail.com
Phone 347221569
It’s possible I am off on this assertion, but check out this attached example. Where it appears to successfully return a positive lookbehind (as long as it is “named”). Curious to hear your thoughts.
blueprint (81).json (5.6 KB)
Well I’ll be. ECMAScript does support all of these as of the 2018 implementation. That’s not what I read on a website about regular expressions but that must have been out of date. You are right!
It looks like this feature is supported in three string functions too:
replace()
match()
(especially if the regular expression has the flag/g
)split()
(note the space at the beginning of' b,c'
):
> 'a, b,c'.split(/,(?= )/)
[ 'a', ' b,c' ]
I wonder if split() in Make supports regular expressions for the second separator argument?