I'm trying to phrase a line using regex but I've no idea how regex works.
This is the pattern I'm using now,
^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*?"(.*?/p/.*?,\d+,(\d+).*?)" "(\d+)" "(\d+)".*$
A sample line I would pharse using the pattern.
124.99.152.202 - naveen [22/Nov/2013:10:41:17 +1300] "GET /p/V4ZkA5d074CTy_vbFa7nLw,1385070078,888888888888888/FOLDER-NUMBER/i-dont-need-this-folder/nope/12.txt HTTP/1.1" "200" "8" "-" "Mozilla/5.0" "-"
Now the problem is I need to get one more bit of info from above sample line.
"GET /p/V4ZkA5d074CTy_vbFa7nLw,1385070078,888888888888888/FOLDER-NUMBER/12.txt HTTP/1.1"
How do I get this FOLDER-NUMBER integer value?
I tried this but I do not know how to filter it out, Regex Fiddle
^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*?"(.*?/p/.*?,\d+,(\d+)/**FOLDER-NUMBER**/.*?)" "(\d+)" "(\d+)".*$
/p/XXXX/what_you_want? or is it sometimes different (in which case, you're going to find this a lot more challenging)?