Please help on RegExMatch

Get help with using AutoHotkey and its commands and hotkeys
User avatar
oldbrother
Posts: 174
Joined: 23 Oct 2013, 05:08

Please help on RegExMatch

16 Feb 2018, 11:25

I have text files using "`r`n" for new lines. I need to use RegExMatch() to find some text, but my code is not working. Am I missing something?

Here is my sample code:

Code: Select all

STR = Somestring`r`n<START>`r`nText1`r`nText2`r`nText3`r`n<END>`r`nTEST

StartStr = ^<START>
EndStr  = <End>$
if (RegExMatch(STR, "m)" . StartStr . ".*" . EndStr, MyTXT))
  MsgBox %MyTXT%
     
Thanks!
User avatar
noname
Posts: 509
Joined: 19 Nov 2013, 09:15

Re: Please help on RegExMatch

16 Feb 2018, 13:17

Just a quick try (btw you made a type fault with <End> must be <END> )

Two options i did not know if you only wanted the text without the marker texts.

Code: Select all

STR = Somestring`r`n<START>`r`nText1`r`nText2`r`nText3`r`n<END>`r`nTEST

StartStr = <START>
EndStr  = <END>
if (RegExMatch(STR,  "`as)" StartStr "(.*)" EndStr , MyTXT))
MsgBox %MyTXT%`n%MyTXT1%
soundcloud.com/user-32706894
User avatar
oldbrother
Posts: 174
Joined: 23 Oct 2013, 05:08

Re: Please help on RegExMatch

17 Feb 2018, 14:54

Thank you very much!☀
User avatar
jeeswg
Posts: 6904
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Please help on RegExMatch

17 Feb 2018, 16:09

Note: RegExMatch has a case-insensitive option: i.

Regular Expressions (RegEx) - Quick Reference
https://autohotkey.com/docs/misc/RegEx- ... tm#Options
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask For Help”

Who is online

Users browsing this forum: boiler, Google [Bot], HarryClash, JackMa, LadyGamer, prakashG and 174 guests