Search found 586 matches

by AlphaBravo
26 Apr 2023, 10:28
Forum: Ask for Help (v1)
Topic: Extract Info from XML File Topic is solved
Replies: 14
Views: 767

Re: Extract Info from XML File Topic is solved

it should still work, anyhow just add "1" after ClientName in your code to capture the subpattern

Code: Select all

FileRead, XMLData, %clipboard%/Status.xml ; Read XML file
RegExMatch(XMLData, "s)<ClientName>(.*?)</ClientName>", ClientName) ; Parse for Client
MsgBox, % ClientName1
return
by AlphaBravo
26 Apr 2023, 10:02
Forum: Ask for Help (v1)
Topic: Extract Info from XML File Topic is solved
Replies: 14
Views: 767

Re: Extract Info from XML File Topic is solved

XMLData := " ( <?xml version=""1.0""?> <ToolStatusReport xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""> <GlobalInformation> <UserName>ADMIN</UserName> <ComputerName>LAPTOP01</ComputerName> <ProjectNumber>0-1000-00001</ProjectNumber> <ClientNa...
by AlphaBravo
25 Apr 2023, 11:24
Forum: Ask for Help (v1)
Topic: Extracting upper cases ?
Replies: 6
Views: 353

Re: Extracting upper cases ?

just add \b

Code: Select all

prodCodes(str) {
 Static regex := "([A-Z] *){3,4}\b"
 Loop Parse, % str, `n, `r
  RegExMatch(A_LoopField, regex, m), out .= RegExReplace(m, "\h+") "`n"
 Return Trim(out, "`n")
}
by AlphaBravo
18 Jan 2023, 12:25
Forum: Ask for Help (v1)
Topic: Ahk v1 Using CaptureScreen by Linear Spoon
Replies: 4
Views: 366

Re: Ahk v1 Using CaptureScreen by Linear Spoon

well, not using CaputreScreen but this worked for me WinGetActiveStats, OutTitle, OutW, OutH, OutX, OutY fileName := A_Desktop "\test.png" if !pToken:= Gdip_Startup() { MsgBox, 131088, , Gdip not loaded ExitApp } pBitmap := Gdip_BitmapFromScreen(OutX "|" OutY "|" OutW "|" OutH) Gdip_SaveBitmapToFile...
by AlphaBravo
08 Dec 2022, 01:35
Forum: Ask for Help (v1)
Topic: Ask a question about Gui edit
Replies: 6
Views: 451

Re: Ask a question about Gui edit

Function from Edit Library Gui, winprogram: New gui winprogram:+alwaysontop gui winprogram:add,Edit,x5 y5 w150 r6 vwinproeditstr HwndhEdit gui winprogram:add,button,x5 y125 gshowdo,[see] Gui, winprogram:Show,w300 h150 y0 return Showdo: gui,submit,nohide Edit_GetSel(hEdit,r_StartSelPos,r_EndSelPos) M...
by AlphaBravo
19 Nov 2022, 17:25
Forum: Ask for Help (v1)
Topic: How do you make a DropDownList of Subfolders
Replies: 4
Views: 417

Re: How do you make a DropDownList of Subfolders

give this a try folderList := ArtistList := "", oArtist := [] loop, files, % "W:\Music\Artists\*", DR folderList .= A_LoopFilePath "`n" for i, line in StrSplit(folderList, "`n") if !InStr(folderList, line "\") oArtist[RegExReplace(line, "^.*\\")] := 1 for Artist in oArtist ArtistList .= (ArtistList?...
by AlphaBravo
19 Nov 2022, 00:06
Forum: Ask for Help (v1)
Topic: Help with RegExReplace Topic is solved
Replies: 3
Views: 414

Re: Help with RegExReplace Topic is solved

Code: Select all

string := "223344-OPERATIONS 21X700 (Line A)"
MsgBox % RegExReplace(string , "^\d{6}-\K\w+|\([^()]*?\)$")
by AlphaBravo
10 Nov 2022, 10:47
Forum: Ask for Help (v1)
Topic: Wildcard in #include Topic is solved
Replies: 1
Views: 207

Re: Wildcard in #include Topic is solved

https://www.autohotkey.com/docs/commands/_Include.htm wrote:FileOrDirName
The path of a file or directory as explained below. This must not contain double quotes, wildcards, or references to non-built-in variables.
by AlphaBravo
18 Oct 2022, 15:55
Forum: Ask for Help (v1)
Topic: Draw a circle in a gui, with color change every 10 seconds.
Replies: 1
Views: 235

Re: Draw a circle in a gui, with color change every 10 seconds.

I would use two images directly like so Red := A_Desktop "\Red.PNG" ; path to your red circle Green := A_Desktop "\Green.PNG" ; path to your green circle Gui, add, Picture, vP w600 h400, % Red Gui, show SetTimer, timer, 10000 ; 10 Seconds return timer: if toggle := !toggle GuiControl,, P, % Green el...
by AlphaBravo
28 Jul 2022, 09:25
Forum: Ask for Help (v1)
Topic: Math, square root
Replies: 11
Views: 1649

Re: Math, square root

Rohwedder wrote:
28 Jul 2022, 01:08
@AlphaBravo, try: Width := 921, Height := 112 ;available area
Number := 92 ;Number of square images
I agree with you, for an edge of 29 you can fit 31*3=93 > 92 squares in a 921*112 rectangle using your method
using the algorithm from StackExchange an edge of 28 gets you 32*4, back to square 1.
by AlphaBravo
27 Jul 2022, 21:04
Forum: Ask for Help (v1)
Topic: Math, square root
Replies: 11
Views: 1649

Re: Math, square root

The brainteaser that I cannot get out of my head is how to do this with a formula and not a loop. I feel there has to be a formula that is probably not all that complicated but it has eluded me for an hour. :headwall: I banged my head against the wall for a bit too when the question was posted :hea...
by AlphaBravo
25 Jul 2022, 10:07
Forum: Ask for Help (v1)
Topic: how to prevent Look-ahead and look-behind assertions have effect on the entire string Topic is solved
Replies: 24
Views: 3561

Re: how to prevent Look-ahead and look-behind assertions have effect on the entire string Topic is solved

Descolada wrote:
25 Jul 2022, 00:58
@rj8810, could you post a concise description of what you are trying to match and what the rules of matching need to be? Preferably post the real haystack you are using, not the one with reds and yellows :)
+1
by AlphaBravo
24 Jul 2022, 17:29
Forum: Ask for Help (v1)
Topic: how to prevent Look-ahead and look-behind assertions have effect on the entire string Topic is solved
Replies: 24
Views: 3561

Re: how to prevent Look-ahead and look-behind assertions have effect on the entire string Topic is solved

Does anyone have any idea how to capture subpatterns with the code of AlphaBravo: H = 111yellow111yellow222blue222red222 RegExMatch(H, "i)yellow(([^ybr]+|y+(?!ellow)|b+(?!lue)|r+(?!ed))?)blue(?1)red", m) MsgBox % m for example the subpattern between yellow and red Keep it simple and run a another r...
by AlphaBravo
22 Jul 2022, 19:53
Forum: Ask for Help (v1)
Topic: how to prevent Look-ahead and look-behind assertions have effect on the entire string Topic is solved
Replies: 24
Views: 3561

Re: how to prevent Look-ahead and look-behind assertions have effect on the entire string Topic is solved

did you try my modified needle from my last post!!

Code: Select all

H = 111yellow111yellow222blue222red222
RegExMatch(H, "i)yellow(([^ybr]+|y+(?!ellow)|b+(?!lue)|r+(?!ed))?)blue(?1)red", m)
MsgBox % m
by AlphaBravo
22 Jul 2022, 17:44
Forum: Ask for Help (v1)
Topic: how to prevent Look-ahead and look-behind assertions have effect on the entire string Topic is solved
Replies: 24
Views: 3561

Re: how to prevent Look-ahead and look-behind assertions have effect on the entire string Topic is solved

made a small adjustment H := " ( xxxyellowyyyyblueñññññredxxxredxxx 111yellow111blue111red111xxxyellowyyyyblueñññññredxxxredxxx _yellow_blue_yellow_blue_blue_red_Yellow_Blue_Red_red_yellow_blue_red )" while pos := RegExMatch(H, "i)yellow(([^ybr]+|y+(?!ellow)|b+(?!lue)|r+(?!ed))?)blue(?1)red", m, A_I...
by AlphaBravo
13 Jul 2022, 14:05
Forum: Ask for Help (v1)
Topic: Replace two RegEx lines with one, how? Topic is solved
Replies: 9
Views: 1151

Re: Replace two RegEx lines with one, how? Topic is solved

Code: Select all

Myvar := RegExReplace(Myvar, "(\s|%$)")
by AlphaBravo
09 Jul 2022, 09:06
Forum: Ask for Help (v1)
Topic: Simple script doesn't work
Replies: 4
Views: 646

Re: Simple sript doesn't work

One more, accounts for upper/lower case

Code: Select all

loop, % 43
	Hotkey, % Chr(A_Index+47), focus
return

focus:
if !GetKeyState("CapsLock", "T")
	StringLower, key, A_ThisHotkey
else
	key := A_ThisHotkey
ControlFocus, somecontrol
Send % key
; or
ControlSend, somecontrol, % key, WinTitle
return
by AlphaBravo
09 Jul 2022, 08:28
Forum: Ask for Help (v1)
Topic: Microsoft.XMLDOM
Replies: 1
Views: 334

Re: Microsoft.XMLDOM

Code: Select all

vendor := xmlDoc.getElementsByTagName("man").item[0]
MsgBox % vendor.text
. "`n" vendor.getAttribute("is_retry")
. "`n" vendor.getAttribute("citizen")
. "`n" vendor.getAttribute("gender")
. "`n" vendor.selectSingleNode("name_lat").text

Go to advanced search