Jump to content

Digisoul

Active Members
  • Posts

    340
  • Joined

  • Last visited

About Digisoul

  • Birthday 09/15/1987

Profile Information

  • Location
    Spain

Recent Profile Visitors

825 profile views

Digisoul's Achievements

Universalist

Universalist (7/7)

1

Reputation

  1. glad to see an impressive update! keep it up
  2. Awesome. Thanks for sharing.
  3. this can extract the last href #include <Array.au3> Local $data = '<td class="F13" colspan="4" align="right">' & @CRLF & _ '<B>1</B>&nbsp;&nbsp;<a href="/IT/Postal_Codes/?page=2&c=AD&n=2&r0=00&r1=04&r2=00&r3=00&r4=00&o=&L=0">2</a>&nbsp;&nbsp;<a href="/IT/Postal_Codes/?page=3&c=AD&n=2&r0=00&r1=04&r2=00&r3=00&r4=00&o=&L=0">3</a>&nbsp;&nbsp;<a href="/IT/Postal_Codes/?page=2&c=AD&n=2&r0=00&r1=04&r2=00&r3=00&r4=00&o=&L=0">Successiva</a>&nbsp;&nbsp;' & @CRLF & _ '</td>' Local $aRet = StringRegExp($data,'(?i)(?!href).*href="(.*?)">Successiva',3) _ArrayDisplay($aRet)
  4. in : '(?s)<a href="Postal_Codes/\?C=(.*?)" itemprop="url">(.*?)</a></span></td></tr>'there are 2 capturing groups, 1: C=(.*?) 2: >(.*?)</a> and the in: 'itemprop="url">(.*?)</a>'there is only 1 capturing group. Also Internet Explorer can change HTML format, but InetRead will return exact Html received from server.
  5. Hello, I am trying to create a regExp for following HTML text: <a href="link=1">1</a> <b>2</b> <a href="link=3">3</a> | <a href="link=2">Previous</a> | <a href="link=3">Next</a>My intention is to extract href from last <a> tag. Here is my attempt: Local $reg = '(?i)\|\s?<a href="(.*?)">Next</a>' Local $text = '<a href="link=1">1</a> <b>2</b> <a href="link=3">3</a> | <a href="link=2">Previous</a> | <a href="link=3">Next</a>' $aData = StringRegExp($text,$reg,3) ConsoleWrite($aData[0]&@LF)Now problem is i am unable to extract exact href from the last <a> tag. Here is the output: link=2">Previous</a> | <a href="link=3I know I can use other techniques, but i want to know, why my pattern is not working or what is the right pattern for such situation? Thanks in Advance.
  6. Sorry for bumping old topic. Can anyone tell why Code folding is not working anymore ? any right direction ?
  7. Hello, I am trying to create a Spell Checker with help of Aspell.exe, my intention is to communicate with Aspell.exe through _NamedPipes_CreatePipe , after reading the following articles & discussions: http://aspell.net/man-html/Through-A-Pipe.html https://www.autoitscript.com/forum/topic/120575-createprocess-with-stdio-solved/ https://msdn.microsoft.com/en-us/library/windows/desktop/ms682499(v=vs.85).aspx I wrote this script: #include <AutoItConstants.au3> #include <WinAPI.au3> #include <NamedPipes.au3> Global $hOutRead, $hOutWrite, $hInRead, $hInWrite Global $hSTD_OUT_ReadPipe, $hSTD_OUT_WritePipe Global $hSTD_IN_ReadPipe, $hSTD_IN_WritePipe $iPID = _Run("C:\Program Files (x86)\Aspell\bin\aspell.exe", " -a", "C:\Program Files (x86)\Aspell\bin") ConsoleWrite("pid:" & $iPID & @LF) ;read 1st msg _ReadMsg() ; try to check spell Local $iData,$nBytes,$tBuffer $iData = "Thq Quick Brown Fox Jumps ovzr tha lezy dog." $tBuffer = DllStructCreate("byte["&StringLen($iData)&"]") $res = _WinAPI_WriteFile($hSTD_IN_WritePipe, DllStructGetPtr($tBuffer), StringLen($iData), $nBytes) ConsoleWrite(">WriteResult:"&$res&":"&$nBytes&@LF) ; totally stuck _ReadMsg() _WinAPI_CloseHandle($hSTD_OUT_ReadPipe) Exit Func _ReadMsg() Local $tBuffer,$nBytes,$rData,$return While True ToolTip("i am stuck") $tBuffer = DllStructCreate("byte[4096]") $sOutput = _WinAPI_ReadFile($hSTD_OUT_ReadPipe, DllStructGetPtr($tBuffer), 4096, $nBytes,0) If $nBytes > 0 Then ; Exit the loop if the process closes or StdoutRead returns an error. $rData = BinaryToString(DllStructGetData($tBuffer, 1)) ConsoleWrite($rData) If StringInStr($rData, @LF) Then ConsoleWrite("msg complete" & @LF) ToolTip("") ExitLoop Else $return = $rData EndIf $tBuffer = 0 $nBytes = 0 Else ExitLoop EndIf WEnd ;-------------- Return $return EndFunc ;==>_ReadMsg Func _Run($location, $sCmd, $sWorkingDir = "", $state = @SW_SHOW) Local $tProcess, $tSecurity, $tStartup Local Const $STARTF_USESHOWWINDOW = 0x1 Local Const $STARTF_USESTDHANDLES = 0x100 ; Set up security attributes $tSecurity = DllStructCreate($tagSECURITY_ATTRIBUTES) DllStructSetData($tSecurity, "Length", DllStructGetSize($tSecurity)) DllStructSetData($tSecurity, "InheritHandle", True) DllStructSetData($tSecurity, "Descriptor", Null) ; Create a pipe for the child process's STDOUT ;************** _NamedPipes_CreatePipe($hSTD_OUT_ReadPipe, $hSTD_OUT_WritePipe,DllStructGetPtr($tSecurity)) _WinAPI_SetHandleInformation($hSTD_OUT_ReadPipe, 1, 0) ; dont inherte it ;~ _WinAPI_SetHandleInformation($hSTD_OUT_WritePipe, 1, 1) _NamedPipes_CreatePipe($hSTD_IN_ReadPipe, $hSTD_IN_WritePipe,DllStructGetPtr($tSecurity)) _WinAPI_SetHandleInformation($hSTD_IN_WritePipe, 1, 0) ; here is the problem ;~ _WinAPI_SetHandleInformation($hSTD_IN_ReadPipe, 1, 1) ;************** ; Create child process $tProcess = DllStructCreate($tagPROCESS_INFORMATION) $tStartup = DllStructCreate($tagSTARTUPINFO) DllStructSetData($tStartup, "Size", DllStructGetSize($tStartup)) DllStructSetData($tStartup, "Flags", BitOR($STARTF_USESTDHANDLES, $STARTF_USESHOWWINDOW)) DllStructSetData($tStartup, "StdOutput", $hSTD_OUT_WritePipe) DllStructSetData($tStartup, "StdError", $hSTD_OUT_WritePipe) DllStructSetData($tStartup, "StdInput", $hSTD_IN_ReadPipe) DllStructSetData($tStartup, "ShowWindow", $state) _WinAPI_CreateProcess($location, $sCmd, 0, 0, True, 0, 0, $sWorkingDir, DllStructGetPtr($tStartup), DllStructGetPtr($tProcess)) Return DllStructGetData($tProcess, "ProcessID") EndFunc ;==>_Run but I am only able to read the 1st introduction line of the Aspell.exe: after that autoit process just stop responding, I am not sure where is the issue or what is the issue. Please help me here. Thanks in Advance.
  8. ​Thank you very much, I only require it for English language. I slightly modified your pattern "(*UCP)(?:^|(\.|!|\?))(\s*\X)" and its working as expected. Thanks Again.
  9. Hello, I want to capitalize 1st word of every sentence with StringRegExp, I am able to collect words by using this pattern: Local $reg = '(?:^|(?:[.!?]\s))(\w+)'now my problem is how can I exactly replace these words, e.g. In the following string: I only want to replace 1st "the" of the sentence with "The" but I have only words in array from RegExp, without its position in string. Thanks.
  10. oh, understood. Thank you very much water.
  11. Hi there, I am using _Word_DocFind to find some text in the .docx file, the search result is okay, but how can I get the page number of the found text ? Here is my rough attempt: $oWord = _Word_Create() $oDoc = _Word_DocOpen($oWord,"C:\test.docx",False,Default,True) $oRange = _Word_DocFind($oDoc,"SLR 1985 PRO 3",0,Default,True) If Not @error Then ConsoleWrite("> TXT Found"&@LF) $oRange2 = _Word_DocRangeSet($oDoc, $oRange) $oRange2.Select ;~ _GetActivePage($oRange2) ; failed ;~ _GetActivePage($oRange) ; failed ;~ ConsoleWrite($oWord.Selection.Information($wdActiveEndAdjustedPageNumber)&@LF); failed Else ConsoleWrite("!Not Found. Error:"&@error&@LF) EndIf Func _GetActivePage(ByRef $oWordApp) Local $iPage = $oWordApp.Selection.Information($wdActiveEndPageNumber) ConsoleWrite(">Active Page:"&$iPage&@LF) EndFuncThanks.
  12. yes it is.
  13. Thank you very much for the function & the link, I tried to find in MSDN, but I was not able to find anything related. Thanks again
  14. Is there any way to get the final source of the email before sending it ?
×
×
  • Create New...