Jump to content

Recommended Posts

Posted

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

Posted

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?

Posted

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...