Hi there,
I'm reading from a logfile and trying to pull out some querystring data. The querystring could be as follows:
cat=xxx&doc=yyy&anyotherdata
cat=xxx&anyotherdata
doc=yyy&anyotherdata
I need to pull out the cat and doc numbers.
The regular expression I have so far works with the bottom two situations, but I can't seem to pull out the data when. Here it is:
s/^([^ ]+ ){6}(cat=(\d+)[^ ]*)?(&)?(doc=(\d+)[^ ]*)?( .*)$/$3\|$6\n/
Any ideas?
Thanks in advance.
I'm reading from a logfile and trying to pull out some querystring data. The querystring could be as follows:
cat=xxx&doc=yyy&anyotherdata
cat=xxx&anyotherdata
doc=yyy&anyotherdata
I need to pull out the cat and doc numbers.
The regular expression I have so far works with the bottom two situations, but I can't seem to pull out the data when. Here it is:
s/^([^ ]+ ){6}(cat=(\d+)[^ ]*)?(&)?(doc=(\d+)[^ ]*)?( .*)$/$3\|$6\n/
Any ideas?
Thanks in advance.