Jump to content

RegExp Help ^_^


Recommended Posts

If i can ask you a last modif @mikell I know it's boring but it's my boss he give me details one after one... not my fault you know me i would give all i can of course...

 

He presented me a string without tel and without field -tel : like this one :

$cString4 = "[BLAA][PO][31][Demandeur][1456460_14564567] Question technique   "& _
                    "Bonjour,"& _
                    "Jordane CARAMEN vous envoie ce message."& _
                    "Bonjour Dans un précédent message"& _
                    "Coordonnées :"& _
                    "- email : mymail@bored.com"

I anomised the string and nothing is missing... until my boss does not give me an other option of possibility.

OF COURSE before ask i tryed myself...

$cPattern = "(?is)\[([^\]]+)\]\[((?1))\]\[((?1))\]\[((?1))\]\[?((?1))?.*?Bonjour,\s*(.+?)\hvous.+?email\h:\h(.+?)"

Work but i have one letter added... and no mail

$cPattern =    "(?is)\[([^\]]+)\]\[((?1))\]\[((?1))\]\[((?1))\]\[?((?1))?.*?Bonjour,\s*(.+?)\hvous.+?email\h:\h"

no letter no mail.... :'(

I am still trying and will come here if i got a working one

zzz this regexp make me so f*** crazy

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

@mikell I am in the engine... I tryed start string to end string starting point after :

But fail ater fail since 45 minutes...

i try that and come in 1 min

 

I dont have the mind for that.... I ll rep+ all your regexp post and will try to learn by following you.

Perfect...

Merci.

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

2 hours ago, caramen said:

He presented me a string without tel and without field -tel

Hmm. Next time there will be the -tel/-tel field , but no -email/-email field ... probably. So let's anticipate :

$cPattern = "(?is)\[([^\]]+)\]\[((?1))\]\[((?1))\]\[((?1))\]\[?((?1))?.*?Bonjour,\s*(.+?)\hvous.+?(?:email\h:\h(.*?))?(?|[\s-]+tél\.\h:\h(.*)?|()$)"

Note that with this one, the array is always 7 elements. If the required info is missing, the row is left empty  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...