Hello all,
I have a problem with a sequence containing a Match pattern module followed by an Array aggregator module.
I have a text from wich I want to match several pattern with the following regex : (?<type_de_contact>(?<=Type de contact : ).*)|(?<siret_compte>(?<=Numéro de SIRET \/ N° de compte client : ).*)|(?<raison_sociale>(?<=Raison sociale : ).*)|(?<code_postal>(?<=Code postal : ).*)|(?<contact>(?<=Personne à contacter : ).*)|(?<tel>(?<=Téléphone : ).*)|(?<email>(?<=Adresse email : ).*)|(?<secteur>(?<=Intéresseé par : ).*)|(?<newsletter>(?<=Newsletter : ).*)
And I get the following outpout, which seems ok for me :
I get an array with 9 collections with 8 out of 9 values being empty in each collection. What I would like is 1 array with 1 collection with all values being filled.
I feel I am missing something obvious or maybe I am misunderstanding what the Array aggregator is supposed to do ?
When reaching out for assistance with your regex pattern for a Text Parser module, it would be super helpful if you could share the actual text you’re trying to match. Screenshots of text can be a bit tricky, so if you could copy and paste the text directly here, that would be awesome! It ensures we can run it against test patterns effectively. If there’s any sensitive info, feel free to change it to something fictional yet still valid by keeping the format intact.
Providing clear text examples saves time on both ends and helps us give you the best possible solution. Without proper examples, we might end up playing a guessing game, and nobody wants that as it is a waste of time! You are more likely to get a correct answer faster. So, help us help you by sharing those text snippets. Thanks a bunch!
@carlo_fitt Seems like you haven’t select the correct source of your array aggregator. I am assuming you have source which is returning 9 output bundles try to select source which have 1 output bundle or paste some more screenshot of your scenario so i can tell exactly.
Hi @carlo_fitt
Your regex appears to be functioning properly. Please attempt the same regex pattern after enabling the single-line mode in the settings."
@Princy Changing the source of the source of the Array aggregator didn’t make any difference because I wasn’t getting 9 output bundles, but 1 outpout bundle with 9 collections in it. So I get the same result while changing the source.
@Msquare_Automation enabling the single line mode doesn’t get me what I want. I do want an output with 9 bundles on the match pattern module, so I get 9 separate key/value that I can store in an Excel file for exemple.
I managed to get what I want with 9 match pattern modules, each with its own regex but it uses way too much operations.
You can use a Text Parser “Match Pattern” module with this Pattern (regular expression):
Type de contact : (?<type_de_contact>.+)\s+Numéro de SIRET \/ N° de compte client : (?<siret_compte>.+)\s+Raison sociale : (?<raison_sociale>.+)\s+Code postal : (?<code_postal>.+)\s+Personne à contacter : (?<contact>.+)\s+Téléphone : (?<tel>.+)\s+Adresse email : (?<email>\S+)[\w\W]+\s+Intéresseé par : (?<secteur>.+)\s+Newsletter : (?<newsletter>.+)
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.
For experimenting with regular expressions, we recommend the regular expressions 101 website. Just make sure to tick the ECMAScript (JavaScript) FLAVOR in the left panel.
@samliew That worked, thanks a lot!
Sorry to bother you again but could you explain quickly the difference between my regex and yours ?
I am not sure I understand why mine didn’t work, I am a beginner with regex.