Menu
I’m trying to modify this Regex:
RegExp(‘
where it only returns a match for this text:
{$REGION ‘Designer Managed Code’}
Help???? I am horrible at regex…just can’t understand them.
<i>
</i>{ opening brace
$ a dollar sign
REGION the letters REGION
. any character
* previous character is matched 0 or more times
} closing brace
[i]Originally posted by 7stud [/i]
[B]ooops. I forgot the 'g'...[/B][/QUOTE]
[i]Originally posted by 7stud [/i]
[B]Huh? [/B][/QUOTE]
[i]Originally posted by 7stud [/i]
[B]Add an 'i' after the 'g' for a case insensitive search. [/B][/QUOTE]
IT caused it to not match when I added it to the expression in Expresso.[/QUOTE]
Expresso is a Regular Expression parser to test regular expressions.[/QUOTE]
<i>
</i><html>
<head>
</head>
<body>
<script language=javascript>
var r =/{$REGION.*}/gi;
var x = "{$REGIONfoo}";
// works also with {$regionfoo} {$RegionFoo} {$rEgIoNFOO} etc.
alert(r.test(x));
</script
</body>
</html>
[i]Originally posted by 7stud [/i]
[B]var r = RegExp("{ $REGION.* }", "gi"); [/B][/QUOTE]
0.1.9 — BETA 5.2