Is your data actually split over multiple lines? Or is it just wrapping in the email?

The problem, I think, is in your second set of parentheses. You search for "," followed by 0 or more word characters, then a colon. That pattern does not appear in your search string.

Also, that .* between your two sets seems a little odd. It will match everything between your first and second matches. But perhaps that's what you want.

This successfully matches your string...maybe it will help you?

var pattern:RegExp = new RegExp('(\"name\":\").*(\",\"[a-zA-Z]* \":)','i');

This matches "name":" and ","id":

Generally speaking, I find the easiest thing to do with regexps is to make them smaller and get the smaller ones working first then string them together.

regards

Guy

On 13/01/2009, at 6:01 PM, flexaustin wrote:

pattern = new RegExp('(?<=\"name\":\").*(?=\",\"\w*:)', 'i');
var resultArr:Array = pattern.exec(data);

resultArr ends up equaling null;

But if you check this: (?<=\"name\":\").*(?=\",\"\w*:) using
http://gskinner.com/RegExr/ it says it works using this data

"error":32,"count":47,"group":true,"connection":39,"warning": 3 ,"name ":"Workstations ","title":"Workstations","model":"workstation","ticket": 1,"type":"TagCategory","id":1

So why is it not working in my code? If anyone has any suggestions I
would appreciate it. I have been trying to get this to work for 10
hours straight.

TIA




Reply via email to