Jump to content

tsue

Active Members
  • Posts

    110
  • Joined

  • Last visited

tsue's Achievements

Adventurer

Adventurer (3/7)

0

Reputation

  1. wow what a great page thanks
  2. my bad i mean keeping regular expressions in the code. just to make the coding better or cleaner like a pro coder will do
  3. hello, i was wondering if there is a better way or a cleaner way to do this with relguar expressions #include <MsgBoxConstants.au3> #include <StringConstants.au3> $line = '<input type="checkbox" name="answers[b]" class="optInput" id="answers_b" /> <pre class="np">text/plain</pre>' $strLetterLeft = 'name="answers[' $strLetterRight = ']"' $findletter = StringRegExp($line, '\Q' & $strLetterLeft & '\E' & "(.*?)" & '\Q' & $strLetterRight & '\E' , 3, 1) For $i = 0 To UBound($findletter) - 1 $strAnswerLeft = '<pre class="np">' $strAnswerRight = '</pre>' $findanswer = StringRegExp($line, $strAnswerLeft & "(.*?)" & $strAnswerRight , 3, 1) For $i = 0 To UBound($findanswer) - 1 $stringrep2 = StringRegExpReplace($line, '<([^%]*?)/pre>', '<b>' & StringUpper($findletter[0]) & '.</b> ') $varStringFinal = $stringrep2 & '<span class="np">' & $findanswer[0] & '</span>' MsgBox(0, "replaced", $varStringFinal) Next Next
  4. tanks it worked $line = '<script type="text/javascript">' $linestringdel = '<script type="text/javascript">' $findanuncios = StringRegExp($line, '(?s)\Q' & $linestringdel & '\E') If $findanuncios = 1 Then MsgBox(0, "found", $line) EndIf $line = 'function killCopy(e){' $linestringdel = 'function killCopy(e){' $findanuncios = StringRegExp($line, '(?s)\Q' & $linestringdel & '\E') If $findanuncios = 1 Then MsgBox(0, "found", $line) EndIf
  5. line is the same string to search $line = '<script type="text/javascript">' $linestringdel = '<script type="text/javascript">' $findanuncios = StringRegExp($line, '(?s).*?(' & $linestringdel & ').*?', 0, 1) If $findanuncios = 1 Then MsgBox(0, "found", $line) EndIf $line = 'function killCopy(e){' $linestringdel = 'function killCopy(e){' $findanuncios = StringRegExp($line, '(?s).*?(' & $linestringdel & ').*?', 0, 1) If $findanuncios = 1 Then MsgBox(0, "found", $line) EndIf
  6. hello, im having trouble detecting a string with regular expressions, here is my code $linestringdel = '<script type="text/javascript">' $findanuncios = StringRegExp($line, '(?s).*?(' & $linestringdel & ').*?', 0, 1) But this wont find the line, $linestringdel = 'function killCopy(e){' $findanuncios = StringRegExp($line, '(?s).*?(' & $linestringdel & ').*?', 0, 1) im assuming its because of '{' but im not sure as im still learning regular expressions but i got stuck with this one for a while now
  7. hmmm i have no clue in what to use
  8. my keys get stuck whenever i run it in java *more specific when opening a java form in the browser
  9. i found that when im in some windows or programs it still get my keys stuck Dim $CSVFILE = @ScriptDir & "\Data\key.ini" HotKeySet("^+!l", "senduser") While 1 Sleep(200) WEnd Func senduser() ;$inirUser = IniRead($CSVFILE, "sinter", "SDU6", "") ;~ send('LALOZOYA') ;~ Sleep(500) ;~ Send("{LCTRL}") ;~ Send("{LALT}") ;~ Send("{LSHIFT}") ;~ Send("{CTRLUP}") ;~ Send("{ALTUP}") ;~ Send("{SHIFTUP}") ;~ send("{SHIFTDOWN}{SHIFTUP}") ;~ send("{ALTDOWN}{SHIFTUP}") ;~ send("{CTRLDOWN}{SHIFTUP}") ;~ ControlSend("", "", "", "user", 0) EndFunc
  10. update: it solved the problem sometimes ControlSend("", "", "", 'DATA', 0)
  11. my bad i didnt add the full script
  12. hello, im having trouble using hotkeyset, whenever i use it my ctrl alt key gets stuck, im trying to release them once the hotkey is given but without any luck #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> Dim $CSVFILE = @ScriptDir & "\Data\key.ini" HotKeySet("^+!l", "senduser") While 1 Sleep(200) WEnd Func senduser() ;$inirUser = IniRead($CSVFILE, "sinter", "SDU6", "") send('sended') Sleep(500) ;~ Send("{LCTRL}") ;~ Send("{LALT}") ;~ Send("{LSHIFT}") ;~ Send("{CTRLUP}") ;~ Send("{ALTUP}") ;~ Send("{SHIFTUP}") send("{SHIFTDOWN}{SHIFTUP}") send("{ALTDOWN}{SHIFTUP}") send("{CTRLDOWN}{SHIFTUP}") EndFunc
  13. no, i need all but AAAAAAAAAAAAAAAAAA ill use if lineread[0] = AAAAAAAAAAAAAAAAAA then "use lineread[1] as it has the other pattern i need" Malkeys post is what i need yust thought i could do this too in a single regularexpression thanks
  14. yes this works really great thankyou is there a way with this line: Formato: AAAAAAAAAAAAAAAAAA Patrón: LLLLAAMMDDGEFCCC99; en donde, L=(A-Z) letra, AA=año, MM=mes, DD=día, G=M ó H, EF= Entidad to just grab LLLLAAMMDDGEFCCC99 with StringRegExpReplace? right now im using global results so when it reads $regex[0] = AAAAAAAAAAAAAAAAAA it change it to $regex[1] because it has it as the second match $regex = StringRegExpReplace($sStr, ".*?([ADLMX]{1,99}).*v*", 3))
×
×
  • Create New...