I want to add any needed conditions to the StringRegExp command so it can pull out only "File.au3", "WinAPIFiles.au3", "Test.bmp" into the array
#include <FileConstants.au3> #include <MsgBoxConstants.au3> #include 'WinAPIFiles.au3' #include "File.au3" ; Script Start - Add your code below here Local $bFileInstall = False ; Change to True and ammend the file paths accordingly. ; This will install the file C:\Test.bmp to the script location. If $bFileInstall Then FileInstall("C:\Test.bmp", @ScriptDir & "\Test.bmp") $sFile = FileRead(@ScriptFullPath) $aResults = StringRegExp($sFile, "(?i)(FileInstall\s*|include\s*)(.*)", 3) _ArrayDisplay($aResults) Thanks In Advance
i have a text : <Name>Jonh</Name>.<Age>15</Age>
how i can get Jonh and 15 in one stringregexp? pls give me example
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.
$vParamData = 'example=value|fruit=apple|phrase=Hello world' $aRegEx = StringRegExp($vParamData, '([^|=]+)=([^|]+)', 3) ; Result ;  => example ;  => value ;  => fruit ;  => apple ;  => phrase ;  => Hello world So that's working fine, but I'm wondering if there's also a way I could have this capture escaped pipes instead of splitting by them.
$vParamData = 'pipe test=this \| is a pipe|example=value' $aRegEx = StringRegExp($vParamData, '([^|=]+)=([^|]+)', 3) ; I'm getting this: ;  => pipe test ;  => this \ ;  => example ;  => value ; But I'd like a result like this: ;  => pipe test ;  => this \| is a pipe ;  => example ;  => value Is there some pattern that would accomplish this, or am I better off parsing it some other way?
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 = '\u001B[4m' ; first iso escape sequence $a = 'Unicorn' ; normal text $a = '\u001B[4m' ; second iso escape sequence ... and so on (note: the above escape sequence has 'control codes' marked as "\u001B' for the asc "esc" char for exemple and a similar notation is also used for other control chars, but in the real string to be parsed those control chars are embedded as a single byte with a value from 01 to 31). at this link (http://artscene.textfiles.com/ansi/) there are many example of real ANSI text files .
searching on the web I've found some possible solutions that make use of regexp to achieve similar purpose, and above some others, the regexp pattern posted in the following link by kfir (https://stackoverflow.com/questions/14693701/how-can-i-remove-the-ansi-escape-sequences-from-a-string-in-python) seems to be able to catch a wider range of ISO escape sequences (not only color sequences), but my lack of skills on regexp, prevents me from evaluating and testing such patterns
I would be very grateful if some regexp guru could come to my rescue...
thanks everybody for reading...