How Can I extract 3 variables from a string with text parser

Hi Maker’s I need a help

I have this TEXT STRING

a:3:{s:4:“name”;s:14:“Carlos Herrera";s:5:“email”;s:15:"dsdsd@gmail.com”;s:5:“phone”;s:13:“+584122677132”;}

I need extract

name: Carlos Herrera
email: dsdsd@gmail.com
phone: +584122677132

I put this pattern on a text parser (?\d{11,12}) and extract phone without problem, BUT i neex extract name anf email too

Thanks a lot for help me

Hi Carlos,

are s:4: s:14: etc. static? Will they always be there? You can then get everything between s:14:" and ";s:5 to find the name.

And this is the reg ex to find email address in a string:

([a-zA-Z0-9+.-]+@[a-zA-Z0-9.-]+.[a-zA-Z0-9_-]+)

Or you can use the same as for the name but between the next two s thingies.

2 Likes

Hello Stoyam thanks for your response

I attach and mark with red what data changed on new record received on the string

I’ve ready the pattern for NUMBER and EMAIL

This is for email: (?([a-zA-Z0-9+.-]+@[a-zA-Z0-9.-]+.[a-zA-Z0-9_-]+))

This is for number: (?\d{11,12})

I need the name and how Can I put it on text prase module on make scenario

and not working
Screenshot_5

Thanks again

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

{s:\d+:"name";s:\d+:"(?<name>.+?)";s:\d+:"email";s:\d+:"(?<email>.+?)";s:\d+:"phone";s:\d+:"(?<phone>.+?)";}

Assuming the order of variables (name, email, phone) will always be in the same order.

Demo link: regex101: build, test, and debug regex


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!

3 Likes

AMAZING thanks a lot, work PERFECT

2 Likes

Yeah it’s amazing what you can achieve with Make with a bit of regular expressions knowledge :slight_smile:

2 Likes