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'd like to replace 'COMMA' with ',' for example:
$myString = "COMMA" StringRegExpReplace($myString, 'COMMA', ',') Now I've tried escaping the ',' in various ways unsuccessfully, such as:
[,] seems to work in the pattern, I just can't figure out how to use it in the replace, and it seems everyone online is only interested in removing/replacing commas lol.
I also tried creating and using a variable as the replacement but also didn't work:
$myComma = "," $myString = "COMMA" StringRegExpReplace($myString, 'COMMA', $myComma) I'm sure it's super simple if someone could point me in the right direction - thanks.
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?
I still suck at regex as always and I need some help. According to the regex tester I normally use this should be working fine but it doesn't....
StringRegExp($sString, "\A[1-9]+[0-9]*(\-[1-9]+[0-9]*)?,*\Z") I basically want to match:
all numbers EXCEPT 0, but including 10, 20, etc with each number separated by a comma and allowing a "-" separated range as a value For example:
1-5,7,10-12 I've spent a couple hours modifying it but I'm not sure where I've gone wrong. Any help would be appreciated!
I need a little bit help from some RegEx experts please:
I would make my ISN AutoIt Studio faster when generating the scripttree. And what would be better to do this via regex?
Problem is i am not really good at this regex stuff. So maybe someone could help me here.
The challange is to get all Global Variables from a script via RegEx in a Array.
Here is a example script with some tests:
Global $Var1 = 1234 Local $Local_Var = 1234 $Ignore_me_too = 1234 Global $Var2 = 1234, $var3 = 1242 Global $ahIcons, $ahLabels Global Const $Var4 = iniread($inivar1,"jj","jj","") , $var5= iniread($inivar2,"jj","jj","") Global $Var_String = "was" Global $Array_Test = [1,15,16,0,31,15,25,15,25,30,8,30,8,15,1,15] Global Enum $MARGIN_SCRIPT_NUMBER = 0, $MARGIN_SCRIPT_ICON, $MARGIN_SCRIPT_FOLD Global Const $Delim = '\', $Delim1 = '|' Global $hard1 = "a", _ $hard2 = "b", _ $hard3 = "c"
The returning array should look like this:
$Var1 $Var2 $var3 $Var4 $var5 $Var_String $Array_Test $MARGIN_SCRIPT_NUMBER $MARGIN_SCRIPT_ICON $MARGIN_SCRIPT_FOLD $Delim $Delim1 $hard1 $hard2 $hard3
I already made some success with a expression i found in the SciTE Jump Tool: (\$\w+)(?:[\h\[.=+*/^,)\-])?
This nearly returns the perfect results. But it does not check if it´s a global variable (with the const and enum options) and also returns variables in commands (for example $inivar1)
I also found this regex: (?im:^(?=Global|Const|Enum|Static)(?:Global)?\h*(?:Const|Enum|Static)?(?:(?<=Enum)\h+Step\h+[+*-]\d+)?\h*)([^\r\n .\=]+)
This returns also usefull results...but trying to understand this explodes my head
Maybe someone can help me here?
Thanks in advance!