RegExMatch - specific beginning of a line Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Scuzzle
Posts: 2
Joined: 21 Feb 2019, 06:51

RegExMatch - specific beginning of a line

06 May 2019, 04:57

Hello,

i want to match the second line:

Code: Select all

txt := "Abweichender Kontoinhaber: Ja`n"
    . "Kontoinhaber: Karl Gustav Schulze`n"
RegExMatch(txt,"^(Kontoinhaber: ).*",kontoinhaber)
msgbox % kontoinhaber
unfortunately, it doesn't...

But the exact same regex here works: https rubular.com /r/4tRikf6YKilaGt Broken Link for safety

Any idea?
Odlanir
Posts: 659
Joined: 20 Oct 2016, 08:20

Re: RegExMatch - specific beginning of a line  Topic is solved

06 May 2019, 05:16

Code: Select all

RegExMatch(txt,"m`a)^(Kontoinhaber: ).*",kontoinhaber)
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode
Guest078
Posts: 22
Joined: 28 Aug 2016, 13:44

Re: RegExMatch - specific beginning of a line

06 May 2019, 05:19

or

Code: Select all

RegExMatch(txt,"m)(*ANYCRLF)^(Kontoinhaber: ).*",kontoinhaber)
just me
Posts: 7747
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: RegExMatch - specific beginning of a line

06 May 2019, 05:21

Code: Select all

Txt := "Abweichender Kontoinhaber: Ja`n"
     . "Kontoinhaber: Karl Gustav Schulze`n"
RegExMatch(txt,"`am)^Kontoinhaber: \K.*$", KontoInhaber)
MsgBox, %KontoInhaber%
:arrow: Regular Expressions (RegEx) - Quick Reference
Kobaltauge
Posts: 260
Joined: 09 Mar 2019, 01:52
GitHub: MassimoCastell
Location: Germany
Contact:

Re: RegExMatch - specific beginning of a line

06 May 2019, 05:33

The problem of your code is the multiline text you're searching. Therefore, you need the switch m) in the solutions of my preposter.
If you need to parse more lines, you have to loop over them.
Take a look at: https://www.autohotkey.com/boards/viewtopic.php?p=275319#p275319

Return to “Ask For Help”

Who is online

Users browsing this forum: boiler, braunbaer, Google [Bot], malcev, mikeyww, neo256, newbieforever, Smile_, swub and 50 guests