Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

RegExMatch - Get all between "End User: " and "|"



  • Please log in to reply
2 replies to this topic
umek
  • Members
  • 84 posts
  • Last active: Nov 11 2015 07:18 AM
  • Joined: 02 Oct 2004

Hi all!

 

Please give me a clue ...

I need to extract the string between "Endkunde: " and the next sign "|". In my case, it finds all between "Endkunde: " and the last sign "|".

 

What I'm doing wrong?

OrderDetails = 
(
Kunden-Nr.: 598341|Endkunde: Herr Dr. Max  Muster-Meyer| Musterstr. 16 / 10245 Musterstadt|
/*  */</script>
)

RegExMatch(OrderDetails, "Kunden-Nr.:\s([0-9]{2,6}).*Endkunde:\s(.*)\|", OrderDetail)

MsgBox, %OrderDetail1%`n%OrderDetail2%

I would be grateful for your hint.

 

 

umek


Works on my machine!

kon
  • Members
  • 1652 posts
  • Last active:
  • Joined: 04 Mar 2013

You can use the U option to make all quantifiers ungreedy. Or, use a ? after any individual quantifier to make it ungreedy.
"Kunden-Nr.:\s([0-9]{2,6}).*Endkunde:\s(.*?)\|"
https://regex101.com/r/eJ5jQ0/1



umek
  • Members
  • 84 posts
  • Last active: Nov 11 2015 07:18 AM
  • Joined: 02 Oct 2004
✓  Best Answer

Of all things the question mark! I had it onto my forehead all the time. That opens possibilities.

Thank you very much!


Works on my machine!