Or you could replace that second part with something like this:
$alphabetsoup = StringSplit('z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a',',')
$location = _ArrayBinarySearch($alphabetsoup,$sz_t) - 1
Return $alphabetsoup[$location]
It appears that (<h2>.+</h2>) is the correct way. I could still go for that DllCall. I don't plan on learning a non-standard implementation of something so widely used across languages.
I remember someone posting it but I can't find it. The built in regular expression engine just doesn't work correctly. I've verified that \<h2\>.+\<\/h2\> should match h2 tags with anything at all inbetween them, but the built in engine chokes on the 12th character colon in <h2>Template:Spanish-name and Template:Chinese-name</h2>. According to the help file, a period should Match any single character. Apparantly not! Anyway, if anyone knows where that dll is that would be helpful.
I developed this because I am working with a program that does not have traditional GUI controls, meaning it definitely did not respect @SW_HIDE, and I wanted to completely move it off the screen before it had a chance to think. I was successful except for the brief flash of the splash screen. With this snippet of code and some trial and error timing, I was able to freeze the splash screen and get the title. As you will see with this code, notepad is frozen so quickly that it doesn't have a chance to draw the GUI. You will need to download process explorer from sysinternals and drop procexp.exe in your @WindowsDir. ;$letter equals the first letter of the process name.
;If the process will be the second, third etc... starting
;with that letter, enter the key n times to arrive at the
;correct process, e.g, _suspend('notepad.exe','nnn)
$process = 'notepad.exe'
$letter = 'n'
Run($process,'',@SW_HIDE)
_suspend($process,$letter)
Func _suspend($process,$letter)
Run("procexp.exe",'',@SW_HIDE)
WinActivate("Process")
ControlSend("Process",'',101,$letter & "!p{DOWN}{DOWN}{DOWN}{DOWN}{ENTER}")
ProcessClose("procexp.exe")
EndFunc Edit: Just call _suspend() again to resume the process! suspend.au3
I just modified larry's example to send a file from the server to the client, but it gets chopped off at around 500 bytes in length. I don't have time to modify it to send the data in smaller chunks, but it would be pretty easy.
To use it, type 'fsend' on the server, and pick a text file, then click ok. When you close the client, it will write the first ~500 bytes of the server's text file to a file called "proofofconcept.txt" on your desktop... TCP_server_client.rar
Matching only the first instance of something happens in your script, not in the expression. I leave translating this into AutoIt's homemade implementation an exercise for the reader. [a-zA-z]{1}[:\\][\d+|\w+|\s+\\]+[\d+|\w+|\s+]\.\w{3} Matches: C:\te43 st\fc oo\bar\ex ample.txt. <-- but not the period Doesn't match: Anything it shouldn't as far as I could tell
I have no idea what most of these do.
#compiler_allow_decompile
#compiler_au3check_dat
#compiler_aut2exe
#compiler_autoit3
#compiler_compression
#compiler_icon
#compiler_outfile
#compiler_passphrase
#compiler_prompt
#compiler_res_comment
#compiler_res_description
#compiler_res_field
#compiler_res_field1name
#compiler_res_field1value
#compiler_res_field2name
#compiler_res_field2value
#compiler_res_fileversion
#compiler_res_legalcopyright
#compiler_run_after
#compiler_run_au3check
#compiler_run_before
I wonder, what of the possibility of then handling exceptions in the functions themselves by ByRef'ing them the for loops variable and allowing them to increment/decrement them.
And it works. This is great, a never-ending loop:
Global $a
For $a = 1 to 2
_decrement($a)
Next
Func _decrement(ByRef $a)
$a = $a - 1
EndFunc