[^,] means match anything except commas, ie the ^ at the start of the
[] indicates that rather than match any of these characters it ought
to not match any of them.
You can't put patterns in the [], it's for defining a list of
characters (or a range, as in a-z).
Guy
On 14/01/2009, at
Yeah that works sort of. The issue is that I need to stop before or
right after a , series.
So given this string:
title:houses,count:47,group:true,connection:39,
I need to stop when I get title:houses, or title:houses or
title:houses or houses. I am trying to extract whatever is given
for
ok. i think you could take a simpler approach then, eg
var pattern:RegExp = new RegExp('\title\:\([a-zA-Z ]+)','i');
var str:String = 'title:houses or houses,count:
47,group:true,connection:39,';
trace(str.match(pattern)[1]);
returns
houses or houses
ie, the matched string is 'title:houses
So for you last version:
var pattern:RegExp = new RegExp('\title\:\([^,\]+)','i');
How would I say everything but a , would it be this?
var pattern:RegExp = new RegExp('\title\:\([^[\,\]]+)','i');
J
--- In flexcoders@yahoogroups.com, Guy Morton g...@... wrote:
ok. i think you could take a
4 matches
Mail list logo