REGEX extract 2 phrases from a text

Hi guys, hope somebody can help me

I’ve a webhook to receive some string like this (in spanish)

Hola, mi nombre es Carlos y mi correo es carlos@carlos.com y quiero un cupo

I need extract the name between MI NOMBRE ES and Y MI CORREO ES like NAME variable, and extract the email address between Y MI CORREO ES and Y QUIERO UN CUPO like EMAIL variable

When I receive the text: Hola, mi nombre es Carlos y mi correo es carlos@carlos.com y quiero un cupo

Need variable NAME= Phrase between MI NOMBRE ES and Y MI CORRE ES
Need variable EMAIL= the email address receive in the text

Thanks

Hi @Luis_Garcia1

Please use the below regex
Input:


Output

Make sure the text arrived lower case

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support
Visit us here
Youtube Channel

Welcome to the Make community!

Screenshot_2024-02-20_151445

You can use a Text Parser “Match Pattern” module with this pattern (regular expression):

mi nombre es (?<name>[\w\W]+?) y mi correo es (?<email>[\w\W]+?) y quiero un cupo

Proof

https://regex101.com/r/I8kP4H

Important Info

  • :warning: Global match must be set to NO!

Screenshot

Screenshot_2024-02-20_151108


For more information, see Text Parser in the Make Help Center:

Match Pattern
The Match pattern module enables you to find and extract string elements matching a search pattern from a given text. The search pattern is a regular expression (aka regex or regexp), which is a sequence of characters in which each character is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.

Hope this helps!

2 Likes

Thank a lot for your help, Work perfect

How can I capitalize the name ? for example, fom carlos to Carlos

3 Likes

No problem, glad I could help!

You can use the You can use the built-in function capitalize

e.g.:

capitalize(name)

For more information, see https://www.make.com/en/help/functions/string-functions#capitalize--text-

1. If you have a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

others can save time when catching up with the latest activity here, and

  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

2 Likes

Here in manychat module how can I put it?

capitalize(6.name)

?

You can manually type the function capitalize(

or select it from the functions panel under the “string” tab

or you can paste this into the field: {{capitalize(6.name)}}

2 Likes