Simple RegExMatch not working

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Guest

Simple RegExMatch not working

13 May 2016, 10:04

I have a notepad document filled with text that displays




Order Notes Private Notes

alsdjfljkasdjflkajdslfjlasfjlkaasdjflasdjfdslajf;dsajf;ldsjf;jsflkdsjf;lajfldsjfal;sjflkdajssl;kfl;kasdflk;saflkjflkaslkdjglkdsahglkas
aljdflkdsajflidshjfdshogfhsfpsahdfdposhfaoifhdsaofhfsahsdfashdfs



Modify Service Order


My code basically click into notepad, copies the text and puts it into the variable bar.

All I want to do is display the text in between Order Notes Private Notes and Modify service Order.


Even when I do script as simple as this, it is unable to match it and displays nothing.

Code: Select all

clipboard = 
MouseClick, left,  711,  244
Sleep, 200
Send, {CTRLDOWN}a{CTRLUP}
Sleep, 1000
Send, {CTRLDOWN}c{CTRLUP}
bar:=clipboard
RegExMatch(bar, "Notes.*Modify", bane)

msgbox %bane%

Any advice would be great.
User avatar
Capn Odin
Posts: 1352
Joined: 23 Feb 2016, 19:45
Location: Denmark
Contact:

Re: Simple RegExMatch not working

13 May 2016, 10:15

Try this.

Code: Select all

RegExMatch(bar, "s)Notes.*Modify", bane)
Please excuse my spelling I am dyslexic.
Guest

Re: Simple RegExMatch not working

13 May 2016, 10:21

@capn odin

Ok that fixed my problem. So I'm guessing the s) had something to do with the spaces?

Thank you very much for the quick response.

While you're here, how do I modify it so that it ONLY displays the text in between Notes and Modify, not including Notes and Modify.
User avatar
sinkfaze
Posts: 616
Joined: 01 Oct 2013, 08:01

Re: Simple RegExMatch not working

13 May 2016, 10:31

Code: Select all

RegExMatch(bar, "s)(?<=Private Notes).*(?=Modify)", bane)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: filipemb and 157 guests