Anas Posted April 16, 2011 Posted April 16, 2011 Hello Is it possible to exclude a group of characters from the returned results without grouping the surrounding characters and splitting the results? e.g. if $String contains 'aaabbbccc' the returned result should be: $Res[1] = aaaccc not: $Res[1] = aaa $Res[2] = ccc thanks
PsaltyDS Posted April 16, 2011 Posted April 16, 2011 Wrong function. Try StringRegExpReplace(). Global $sText = 'aaabbbcccdddeee' $sText = StringRegExpReplace($sText, "[bd]", "") MsgBox(64, "Result", $sText) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Anas Posted April 16, 2011 Author Posted April 16, 2011 I can't use StringRegExpReplace, because I have a list of patterns that StringRegExp loops through and each group of characters has its own matching characters. I only want to exclude the 'non-Capturing' groups which may or may not be there. I take it that it can't be done using StringRegExp?
UEZ Posted April 16, 2011 Posted April 16, 2011 Something like that? $string = "aaabbbccc" & @CRLF $string &= "fffaaahhhccccuuu" & @CRLF $string &= "qqqaaajjjjcccciiii" & @CRLF $string &= "aaacccciaaacclllaaa" & @CRLF MsgBox(0, "StringEx", StringRegExpReplace($string, "[^a|^c|\s]", "")) Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now