Jump to content

Search the Community

Showing results for tags 'regular expression'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office


  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start






Found 22 results

  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 StringRegExp: How to get 'ABC' from it? I'm not sure if the original string uses @CRLF, @CR or @LF as a line breaks (received from linux over ssh plink.exe) I have tried this code but it doesn't work #include <Array.au3> $sLog = "main_lot 0x111&rdq
  2. This is a program that I made to help my self learn better regular expressions. There are a lot of other programs/website with the similar functions. The main advantage of this program is that you don't have to click a button after every changes. The program detected changes and react on it. Function: Match Match of arrays Match and replace Load source data from website Load source data from a website with GET/POST Load text data from file Clear fields Export and Import settings (you can finish the expression a other time, just expo
  3. Hi all, is there a regular expression pattern that can be used to remove part of a string based on the position of the substring, that is, by specifying the start and end characters of the block to remove? thus obtaining a new string without the "piece" indicated. for example: Global $sString = "Today I do not feel good" ; chars: 000000000111111111122222 ; 123456789012345678901234 ; remove a chunk from char 9 to char 15 MsgBox(0, '', _StringTrimMid($sString, 9, 15)) ; Returns the string trimmed by characters from $iStartCut
  4. Hi, I have a string like this : Global $Msga = "urrent directory is /send. (Submission of file with log number 29381077284 is confirmed)"; I want to extract the number 29381077284 from the string. I did StringSplit to split based on "(" and then use space to reach there, But it's not a good choice. Can anyone help me with regular expression to find the number from String using AutoIT. TIA
  5. Hello if I have a string like in the example below, is there a regular expression that can surround any "string" (and only strings) within quotes?. The whole input string is a "constructor" to populate an array so even if an element contains more words (a phrase) it should be considered as a single word (Elton John should be considered a single word and as that quoted as "Elton John") for example the following string [[Elton John,Peter,Sally,123],[1 one 1,2,3,4 four 4]] should be transformed to this other string [["Elton John","Peter","Sally"
  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. Hello, I'm trying to match the second to last line of this: foo C:\ foobar foobar x C:\temp\dir Last line with chars Here's my code: $test = 'foo' & @CRLF $test &= 'C:\' & @CRLF $test &= 'foobar' & @CRLF $test &= 'hello' & @CRLF $test &= 'C:\temp\dir' & @CRLF $test &= 'Last line with chars' & @CRLF $test &= @CRLF $test &= @CRLF $result = StringRegExp($test, '(?m)^C:\\.*$Last.*') MsgBox(0, '', $result) I'm trying to match line "C:\temp\dir". An
  8. I'm looking for a regex genius, cus I'm stumped when it comes to assertions. So what I have now, is this regular expression: ([^|=]+)=([^|]+) It takes a string (user input) of keys=values separated by pipes (ie: "param=value|param=value") and splits them into an array. Example: $vParamData = 'example=value|fruit=apple|phrase=Hello world' $aRegEx = StringRegExp($vParamData, '([^|=]+)=([^|]+)', 3) ; Result ; [0] => example ; [1] => value ; [2] => fruit ; [3] => apple ; [4] => phrase ; [5] => Hello world So that's working fine, but I
  9. regex and iso escape sequences Hi, I would like to extract all ISO escape squences embedded in a string and separate them from the rest of the string, still keeping the information about their position, so that, for exemple, a string like this one (or even more complex): (the string could start with normal text or iso sequences) '\u001B[4mUnicorn\u001B[0m' should be 'transformed' in an array like this $a[0] = '\u001B[4m' ; first iso escape sequence $a[1] = 'Unicorn' ; normal text $a[2] = '\u001B[4m' ; second iso escape sequen
  10. I am trying to identify the window based on the window title and text. The title will be the "erwin DM - filename" It is working till date, but some operating systems our application is displaying window as "erwin DM - [filename]" I tried "erwin DM - *filename*" But this regular expression is not working. Any suggestion? $sModelFile = "C:\Users\Administrator\Documents\My Models\eMovies.erwin" $wdModel = _WinWaitActivate1("erwin DM - "&FileNameOnly($sModelFile),"") Func _WinWaitActivate1($title,$text,$timeout=0);Will Return
  11. Hi all, it's been a while since I last used regular expressions and I find myself out of time to experiment with this particular issue, so I throw myself upon your mercy and expertise. I am looking to create a function that will say whether or not a supplied string is a valid UUID or not. Local $sTestF = '4C4C4544-004A-4C10-8054-B7C04F46343' Local $sTestT = '4C4C4544-004A-4C10-8054-B7C04F463432' ConsoleWrite('False = ' & _IsValidUUID($sTestF) & @CRLF) ConsoleWrite('True = ' & _IsValidUUID($sTestT) & @CRLF) Func _IsValidUUID($s
  12. I am looking to writing an automation script for converting the following SQL procedure code into VBCode as shown below Example ALTER PROCEDURE [dbo].[firstprocedure] (        @var1 varchar(10),        @var2 varchar(7),        @var3 float )    CONVERSION Public Function firstprocedure(ByVal var1 As String, ByVal var2 As String, ByVal var3 As Integer) As DataSet         Dim ds As New DataSe
  13. Hi all. I'm revisiting poorly commented code of mine from over a year ago. In one line I search a string for a regular expression and cannot figure out exactly what the code is searching for. The expression is: .+(?>\R) I've tried to piece it together from the StringRegExp() page. My educated guess is that it searches for newline characters in some capacity. Here is what I have so far: (?>\R): The (?>...) indicates an atomic non-capturing group, meaning in-part that string matches are not recorded for later reference. I'm not sure what the 'atomic' means though.
  14. mikell ;Global $sCharAllowed = ";!#$%&'()+-,.0123456789=@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{ }~" Local $uStringIN = "頹-衙-浳-浤-搰-橱-煪๏๐๑๒๖D๚๛ẀẁẂẴẵẶặẸẹẺẻỈỉỊAịỌÆ¢™®¯ÌÍÎÏÐÑ×ØÙòóôŘřŢţŷOŸǾǿ₪₫€℅l№™Ωe⅛∑-•v8∫˜≠==□ּׂאַאָאּבּVגּדּהּוּזטּיּךּכשּתּוֹבֿכֿפֿAﭏﭽﮊﮋﮏﮐﮑﮒﮓﮔﺅﺆﺇTﺈﺉﺊﺋﺛﺜﺝﺮﺯﺰﺱﻐRﻑﻒﻓﻔﻕﻟﻠﻡﻢﻣﻤOﻥﻦﻧﻨﻰﻱﻲﻳﻴﻵﻶNﻷﻸﻹﻺﻻﻼْ%-㍱G-煱-둻-睤-㌹-" Local $lStringOUT = StringRegExpReplace($uStringIN, '[[:^print:]]', "
  15. I wrote a program to convert single and double quotes to curly single and double quotes. The program uses regular expression search and replaces to swap the straight quotes to their curly counterparts and to ignore any HTML tags, too. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <FontConstants.au3> Func Curlify($sInput) Local $sOutput = StringRegExpReplace($sInput, "'(?!([^<]+)?>)", "’") $sOutput = StringRegExpReplace($sOutput, "((^|\s+)(<[^>]*>)*)’", "${1
  16. Hi, I don't understand why this expression is not lazy: $path = "some\path\that\annoys" ConsoleWrite(StringRegExpReplace($path, "\\.+?$", "", 0) & @CRLF) I'm trying to delete just "annoys" but the regexp matches "paththatannoys"
  17. I want to generate a regex from an user input and need a regex prepare function. I couldn't find any in the documentation, am I missing something? It should escape out all regex characters, so like "te.st" would become "te.st".
  18. I haven't posted anything in the examples section for about 6-7 weeks, so felt it was that time again. This shows how to use the string functions of AutoIt and regular exp<b></b>ressi&#111;ns. The header pretty much explains what the function(s) do. #include <MsgBoxConstants.au3> #include <StringConstants.au3> MsgBox($MB_SYSTEMMODAL, '', _FilePrefix(@ScriptFullPath)) ; Append _ thus creating C:\Example\Test_.exe MsgBox($MB_SYSTEMMODAL, '', _FilePrefixSRE(@ScriptFullPath & '.text')) ; Append _ thus creating C:\Example\Test_.exe ; #FUNCTION# =================
  19. :idea:Someone should figure out an easier way to match things than using regular expressions. I need some help matching things -- I can't seem to get my regular expressions to work. So here is what I am trying to do: Basically, I want to have just the hilighted parts extracted. I am trying to match them using "N100 (" and "(STARTMOP)" and "(ENDMOP)" to define what to extract, but I am having trouble getting a regular expression that matches anything - I just get errors Can anyone help? (BTW, I am using GEOSoft's PCRE Toolkit to test my regular expressions)
  20. I want to remove all characters in a string, from an Asterisk to the end of the string, but the End Of Line regular expression character ('$') does not work for me. $pat = "[*]$" consolewrite("+++: " & StringRegExpReplace("D:\Temp\File.txt * 2abc def" ,$pat, "") & @CRLF $pat = "[*]" consolewrite("+++: " & StringRegExpReplace("D:\Temp\File.txt * 2abc def" ,$pat, "") & @CRLF results in: +++: D:\Temp\File.txt * 2abc def +++: D:\Temp\File.txt 2abc def I expected the first result to be: "+++: D:\Temp\File.txt " (The second result just removed the Asterisk, as I expected.
  21. Could someone make a pattern for this. Been testing out various patterns for hours. String <div class="profName"><a href="ShowRatings.jsp?tid=1632499">Abaquita, Edwin</a></div> My Pattern (?<=\QShowRatings.jsp?tid=\E).*(?=\Q</a></div>\E) I just need the name (Abaquita, Edwin). The problem with my pattern is the link number (1632499) changes with every name and there are multiple names on a page, also the number of digits varies with each name. Thank you in advance.
  22. _DOSWildcardsToPCRegEx (+GUI) While I've posted an earlier version of this elsewhere (I will redirect to here don't worry), I figured I might as well provide a GUI interface to expose what this function does and returns, and allow its results to be copied/pasted elsewhere (like to AgentRansack, a free file-search tool supporting PC Regular Exp​ressions). So here you'll find both the GUI interface and the UDF itself. What it does: Takes a DOS wildcard exp​ression (ex: '*.*','*.jp*g','logfiles.l?g') and converts it into a PC Regular Exp​ression. This function in its original form, _FileMatch(
  • Create New...