If instring regex Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Pilu
Posts: 84
Joined: 22 Jun 2018, 01:13

If instring regex

28 Jul 2021, 01:27

Hi
I would like check the string, that it contains a criteria. Every criteria structure like this but contains different number and word, but the length is fixed. every time it start with ~ and end with ~. it start with 32 character what contains mixed letter and number, after _ sign and at the end 14 digit.
Example ~c0830ca4bd8ce9d99d16e1f254f684bb_20210213~.
I would like if the string countains same string give back a msgbox with yes. I do not really understand the regex so can somebody help me.
thanks
User avatar
boiler
Posts: 16902
Joined: 21 Dec 2014, 02:44

Re: If instring regex  Topic is solved

28 Jul 2021, 04:59

Your example didn't have 14 digits after the _, so I think you want it like below:

Code: Select all

Str := "~c0830ca4bd8ce9d99d16e1f254f684bb_20210213000000~"
if RegExMatch(Str, "~[a-z0-9]{32}_\d{14}~")
	MsgBox, yes

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, inseption86, KruschenZ, mikeyww, Swiftly9767 and 295 guests