Jump to content

Search the Community

Showing results for tags 'Regexp'.

  • Search By Tags

    • regexp ×
    Type tags separated by commas.
  • Search By Author

Content Type



Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


  1. Hi everyone, I have this string: "main_lot 0x111” & @CRLF & “main_version 0xABC” & @CRLF & “main_number 0xDEAD123” & @CRLF & “main_version 0x333" And I'm trying to extract one specific hexadecimal number, actually main_version from this string by using StringReg...
  2. Well the plan is to use the power of regular expressions engine of AutoIT for patching binary data. Something like this: StringRegExp( $BinaryData, "(?s)\x55\x8B.." <cut> ... Okay straight to question/problem ... certain bytes that are in the range from 0x80 to 0xA0 won't match....
  3. Hi, Please help me to change metasymbol line. Right now I have this condition code: If StringInStr($_sName, 'TEXT ') Then $_sName = StringRegExpReplace($_sName, '(^.*)\TEXT (.*)$', '$2') $_sName = StringRegExpReplace($_sName, '(^.*)\ (.*)$', '$1') If Not CheckIsSave_($_sName)...
  4. Version 3.6

    2,127 downloads

    In April 5, 2013 I ask @Lazycat he answer: Then I change this tool a little. Now I back to this and make bigger changed. Here is new version. Update History: = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =...
  5. I'm trying to capture everything after a "#ToDo" in my scripts. I got that like this: (?i)[^\v]*#todo(.*) But then I thought it would be nice to use underscores to continue the ToDo... kind of like this: #ToDo: This is a really long explanation about something _ # that is very in-depth an...
  6. Inspired by PHP's preg_split. Split string by a regular expression. Also supports the same flags as the PHP equivalent. v1.0.1 Example: #include "StringRegExpSplit.au3" StringRegExpSplit('splitCamelCaseWords', '(?<=\w)(?=[A-Z])') ; ['split', 'Camel', 'Case', 'Words']
  7. Hi guys I need your help. I have string like this : "TDM111A5, RCT222Y5/ 7 ; FDT444E4 /8 , ABC222R5" I need find a coma or semicolon and delete white spaces before and after them The output should be a string and/or array String : "TDM111A5,RCT222Y5/ 7;FDT444E4 /8,ABC222R...
  8. Is there a way to output the regex matches into a file? I have a script to compare two files and check for regex matches. I want to output the matching regex of 'testexample.txt' to another file. #include <MsgBoxConstants.au3> #include <Array.au3> $Read = FileReadToArray("C:\Users\adm...
  9. Im creating a code that will work in this sequence: 1. Copy the text (question) in one atea of the screen 2. Catch the 2 strings (number) 3. Multiply the 2 strings ( $1*$2) 4. Click the next area to put the answer 5. Paste the answer This is my code M...
  10. argh, pulling my hair out. considering this post: say for a string = "03a", how can I strip out the leading 0 and the a. I have tried: $new = StringRegExpReplace($string, '[^1-9][^0-9]', '') and various combinations: ^0+[^0-9] [^[:digit:]] "[^0...
  11. Hi everyone! After updating autoit, I tried to run an old program using complex regexp's. It did not work. Eventually I broke the problem down to this example: #include <Array.au3> $buf = "First title" & @CRLF & "Tom" & Chr(0x92) & "s sleepwalking" & @CRLF & "Last | line" & @CRLF...
  12. Hello . How to do that $regexp = starts from "abcdef" and after this could be anything in name WinActivate($regexp)
  13. Text in a file, read into var with fileread: <> <> <> <> < J please look > <> <> <> Hi, I want a RegExp to select around 'please', back to the previous < and forward to the next >. I can select the line of text. Then I add in (?s) and it selects the whole text. I think I want to mak...
  14. I want to rename every new instance of notepad to notepad(random number) If I use WinSetTitle ( "notepad", "", "notepad("&$randomnumber&")" ) this will work pretty good, because if more windows match the search entry it will take the newest. But what if this code runs, but there is no new...
  15. #include <Array.au3> If @Compiled Then Exit Global Enum $FUNC_OUTER, $FUNC_NAME, $FUNC_PARAM, $FUNC_INNER _Example() Func _Example() Local $sIncludeDir = StringTrimRight(@AutoItExe, StringLen('AutoIt3.exe')) & 'Include\' Local $aOuterArray = _GetFunctionsToArray($sIncludeDir & 'Color.au3') If...
  16. #include <Array.au3> ; Script Start - Add your code below here Local $test = "<li>One<li>Inner<li>Innermost</li></li></li>" & _ "<li>Two</li> " $loob = StringRegExp($test, '\Q<li>\E(.*?)\Q</li>\E', 3) _ArrayDisplay($loob, "How to return the One... and Two?") Hello, can somebody help me: (...
  17. Hello, Have been thinking about this for a while, so decided to seek for help. I have the following string: "...<tag>1</tag>...<tag>2</tag>...<tag>3</tag>...", which I need to test if all text within <tag> matches certain criteria, e.g. it's a number "\d+". The trick is 1) I need the entire match to...
  18. 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>...
  19. 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 w...
  20. Hi I am struggeling around with an RegExp I need to check a string, it should only contain digits and a - This is what i have so far StringRegExp($sColData,"[\s\D]",0)which returns true for every non-digit (\D) character including @CR (which should not exist as well) and whitespaces (\s], bu...
  21. Hello, Not sure if I asked the right question but how do I modify the pattern so that it only matches the second test string? $sTest1 = 'bErtrTRtrtXa' $sTest2 = 'ErtrTRtrtX' $sPattern = 'E[A-Za-z]{0,}X' Local $iResult1 = StringRegExp($sTest1, $sPattern) Local $iResult2 = StringRegExp($sTest2,...
  22. Hi all, How to get nth line text from a given text with Regexp. For example, i have a text from a window which contains 15 lines. And i need to get the text from 5th line (it may vary). How to do it. I have tried some patters like "(^ &)5" and "[^ $]{5}". But didn't work.
  23. Hi all, How to find first and last word in a sentence with Regular expression ?. Sentence is the code from SciTE. For example if sentence is; "For $i = 0 to 15" I need to extract "For from the sentence And the same way i need last word from a sentence "If Apple = 15 Then" I need "Then" from...
  24. I have constants A and B and C, in fact they are not one char but whole word and they can be included at the end of test text in parenthesis there can be only one of them but also two of them or all three separated by coma in any order (A) or (A,B ) or (C,A) or (A,B,C) or (A,C,B ) ... I need to...
  25. I'm doing parsing of HTML file with <table>. I need to go through rows and columns of table, ideally to get two dimensional array. I use this way with simple two levels of calling StrinRegExp() for rows and columns: ;~ $html = FileRead('table.html') $html = '<tr><td>r1c1</td> <td>r1c2</td></tr>...
×
×
  • Create New...