What's wrong with my RegexMatch

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Mimir
Posts: 1
Joined: 14 Aug 2018, 12:12

What's wrong with my RegexMatch

14 Aug 2018, 12:31

I recieve automated filings as an email and I'd like to get the data out of them in a parsable way.

The emails always look something like this:
This is an automated message, etc. There is a lot of information hereThen, on a new line

Court Number: 0:20-cvxyz-12345-ABC Irrelevant Text

Then, there is a bunch more information, which might include two or five digit numbers, and the text "Case Number".
What I'd like to get out is the year [two digit string] and the five digit string, which must be on the same line as the text "Case Number." I'd only like to get it out the first time it appears in the text.

What I have now is:
clipboard = %clipboard% ;remove formatting
email := clipboard ;make a string named “email”.
FoundPos := RegExMatch(email, "imOU(<titletext>Case Number):\s*.*(<year>d{2}).*(<CourtNo>d{5})", courto) ;this is the problem area
MsgBox % courto[titletext] courto[year] courto[CourtNo]
Please let me know what I'm missing here - I'm very new to both Regex and AHK, and understanding what I need to do here would help me save a lot of time. I'm not sure if I'm getting the Regex wrong or the AHK wrong.

Thank you in advance for your time and help.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], mebelantikjaya, NinjoOnline and 282 guests