Regex question


i am trying to get an citrix application out of netscaler logs. below is a snippet of the log

  • applicationName Outlook 2010 - startTime "05/19/2016:16:04:21 " -

I am trying to get up until the " - " so i can parse it out but am having issues. the following regex test gives back the right results but in the trigger i keep getting null.any suggestions would be great!

var app = /applicationName ([^[:space:]]+[^-]+)/.exec(data);


Looks like you’re trying to use a egrep regular expression, not a js regexp. Perhaps try this:


“applicationName, zero or more spaces, followed by any non-dashes, zero or more spaces, and then a dash”.

Parens are located to capture just the application name (Outlook 2010 in your example.)


That worked. Unfortunately in doing this i realized some of the applications have a " - " would there be a way to crab up until the “- startTime”


Perhaps, this?


This will grab any character between “applicationName + [space]” and “- startTime”, including dashes, spaces, and other characters.


You could try this one:
/applicationName ([^-]*) - ([^ ]*) "([^ ]*) " -/

This captures all the groups I assume you might want. It assumes the application name has no dashes “-”, the “startTime” token has no spaces, and the time value has no spaces to capture the right tokens. You could then use group[1] for application name, group[2] for the, I assume, startTime/endTime, and group[3] for the time value.


that worked great! thank you!


thank you dbenson, unfortunately some of the groups have a “-” in them so i had to go off the “startTime” part since thats the gap.