Jump to content

Recommended Posts

Posted

comme si c'etai fait !

Ty i give you feed back in 1minute52

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

  Reveal hidden contents

 

Posted (edited)

Look i put all possible cases in one script so i can multi test with one pattern without recoding.

 

Only work for case 2

 

#include <Array.au3>
#include <StringConstants.au3>



$cString =  "[****][PO][31][Demandeur] dghdfjgfdssfghchnique" & @CRLF & @CRLF & _
                    "Bonjour," & @CRLF & _
                    "Charles HENRY vous envoie un message." & @CRLF & _
                    "J'ai un problème de toilette" & @CRLF & _
                    "Merci de m'aider" & @CRLF & _
                    "- email : Jordane.AutoIT@AutoITForum.com" & @CRLF & _
                    "- tél. : 060***909"

$cString2 = "[****][PO][31][Demandeur][161560_1550869077] dghdfjgzardytrezq technique" & @CRLF & @CRLF & _
                    "Bonjour," & @CRLF & _
                    "Charles HENRY vous envoie un message." & @CRLF & _
                    "J'ai un problème de toilette" & @CRLF & _
                    "Merci de m'aider" & @CRLF & _
                    "- email : Jordane.AutoIT@AutoITForum.com" & @CRLF & _
                    "- tél. : 0607****09"

$cString3 = "[****][PO][31][Demandeur] dghdfjgfds technique" & @CRLF & @CRLF & _
                    "Bonjour," & @CRLF & _
                    "Charles HENRY vous envoie un message." & @CRLF & _
                    "J'ai un problème de toilette" & @CRLF & _
                    "Merci de m'aider" & @CRLF & _
                    "- email : Jordane.AutoIT@AutoITForum.com" & @CRLF & _
                    "- tél. : "

$cString4 = "[*****][PO][31][Demandeur][161560_1550869077] Question technique   "& _
                    "Bonjour,"& _
                    "PI****E GUE****A vous envoie ce message."& _
                    "Bonjour Dans un précédent message"& _
                    "Coordonnées :"& _
                    "- email : *********21@****.com"& _
                    "- tél. : 0****3304"

$cString5 = "[*****][PO][31][Demandeur] Question technique   "& _
                    "Bonjour,"& _
                    "PI**R****E GU*****A vous envoie ce message."& _
                    "Bonjour Dans un précédent message"& _
                    "Coordonnées :"& _
                    "- email : *****@****.com"& _
                    "- tél. : "

$cString6 = "[****][PO][31][Demandeur][161560_1550869077] Question technique   "& _
                    "Bonjour,"& _
                    "PI****TTE GU****A vous envoie ce message."& _
                    "Bonjour Dans un précédent message"& _
                    "Coordonnées :"& _
                    "- email : ***21@**.com"& _
                    "- tél. : "

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

$arrResult1 = StringRegExp($cString, $cPattern, $STR_REGEXPARRAYGLOBALMATCH)
If IsArray($arrResult1) Then
    _ArrayDisplay($arrResult1)
Else
    MsgBox (0,0,"Fail String 1")
EndIf


$arrResult2 = StringRegExp($cString2, $cPattern, $STR_REGEXPARRAYGLOBALMATCH)
If IsArray($arrResult2) Then
    _ArrayDisplay($arrResult2)
Else
    MsgBox (0,0,"Fail String 2")
EndIf

$arrResult3 = StringRegExp($cString3, $cPattern, $STR_REGEXPARRAYGLOBALMATCH)
If IsArray($arrResult3) Then
    _ArrayDisplay($arrResult3)
Else
    MsgBox (0,0,"Fail String 3")
EndIf

$arrResult4 = StringRegExp($cString4, $cPattern, $STR_REGEXPARRAYGLOBALMATCH)
If IsArray($arrResult4) Then
    _ArrayDisplay($arrResult4)
Else
    MsgBox (0,0,"Fail String 4")
EndIf

$arrResult5 = StringRegExp($cString5, $cPattern, $STR_REGEXPARRAYGLOBALMATCH)
If IsArray($arrResult5) Then
    _ArrayDisplay($arrResult5)
Else
    MsgBox (0,0,"Fail String 5")
EndIf

$arrResult6 = StringRegExp($cString6, $cPattern, $STR_REGEXPARRAYGLOBALMATCH)
If IsArray($arrResult6) Then
    _ArrayDisplay($arrResult6)
Else
    MsgBox (0,0,"Fail String 6")
EndIf

 

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

  Reveal hidden contents

 

Posted

@caramen
In your above post starting with "Look i put all possible cases in one script ....", try replacing the RE pattern, $cPattern in the example with :-

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


 

Posted (edited)
  On 4/3/2019 at 11:27 PM, Malkey said:

@caramen
In your above post starting with "Look i put all possible cases in one script ....", try replacing the RE pattern, $cPattern in the example with :-

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


 

Expand  

Working great. I'll now push the test to the prod.

big thanks i come back to say if it totaly work or not.

 

Good game man it's the first attemp that success anytime for the moment.

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

  Reveal hidden contents

 

Posted

Obviously when all possible cases are mentioned the requirements are different...

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

 

Posted

I mentioned all case but yeah it’s easyer when we see cases than when we dont.

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

  Reveal hidden contents

 

Posted

Btw i’m in bus right now so i cannot test.

but does these two regexp have lazy parameter ? 

I wont use regexp without lazy parameter when i can. 

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

  Reveal hidden contents

 

Posted (edited)

With this pattern : **** 

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

It left a last thing to fix haha... 

 

It work in my exemple but not with the same exemple in real case. 

Maybe it s becose the structure is not same. 

 

But not even one letter is changing. So i dont figure out what's happenning. 

Look the Raw5 i have the message body when i dont want it. So i cannot extract name. Or i have to stringsplit again. WE 'RE SO CLOSE !!! ^^

image.png.4c03b0f6b0af711f6d1d4bf134a82e85.png

And a detail but i cant fix it with stringStripRight i guess. 

Row 6 ->  .com"-"

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

  Reveal hidden contents

 

Posted

And with this pattern

 

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

All working fine until now ..  i ll give more info after more test. 

But i have no doubt with mikell's pattern i wont have problem i bet on it !

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

  Reveal hidden contents

 

Posted

@caramen
Hard words, but true:

  Reveal hidden contents

:)

 

Click here to see my signature:

  Reveal hidden contents

 

Posted (edited)

I dont get it -.- ?

Someone posted this and it has been deleted ?

Or it s you preparing myself to get my mind explode by theses words x) ?

 

Anyway i tryed to be the more explicit as possible. I have confidential information and i put ** on them. 

I will just ignore that post. 

 

Anyway @mikell pattern is just perfect. 

With 2 attemps and the explanation provided.

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

  Reveal hidden contents

 

Posted (edited)
  On 4/4/2019 at 11:00 AM, FrancescoDiMuro said:

Change them, but be coerent with the requests you do (don't change a number with asterisks, or the pattern will fail).

Expand  

This is obvius... 
I did that on the fly becose i posted the confidential information without hidding them. You can see in my first post it was not astrisks

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

  Reveal hidden contents

 

Posted (edited)

You know what? Pattern is working . 

End of story. 

I dont like the turn that it take. 

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

  Reveal hidden contents

 

Posted

FOR PEOPLE WHO DONT WANT TO HELP IF YOU FEEL MY INFORMATION MISSING OR SOMTHING PASS YOUR WAY. 

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

  Reveal hidden contents

 

Posted
  On 4/4/2019 at 10:58 AM, caramen said:

Anyway @mikell pattern is just perfect. 

Expand  

Glad I could help  ^_^

But please keep cool. Francesco's words are a bit rude but they are not totally false
He provided a lot of answers - which means a lot of time and thinking - while the requirements were continuously changing. This topic is now 3 pages long and could have been much shorter  ;)
The main rule when asking for regex help is : first consider all possible cases likely to occur, and when done then work to find the best pattern and ask for help. This is better as much for you (to get the correct answer faster) as for helpers (less time/energy to spend)

BTW I didn't provide explanations for my pattern. Lazy I am... so If you need some then feel free to ask  :)

Posted (edited)

@FrancescoDiMuro @mikellDont worry me and Francesco are mate ;) We talk a lot in PM 

but i bet it 's not his words. 

 

It's not even possible for me to be hungry after him since he help me sooooooo much soooo much time

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

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

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