10.177.116.76 - U031503@nttdata [11/Mar/2013:09:42:44 +0900] "GET /infovia/ga/ga004rp0002.action HTTP/1.1" 302 301 "https://tb-infovia.groupwide.net/infovia/ga/ga013rp0004.action?messageId=errors.Authentication.001" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322)"
The above is the access log line. There are two action ids.
I want to extract the first action id before HTTP by using regex pattern.
Now I use this pattern ([^/\"]*).action.
It matched both action id in line anywhere.
I was testing this problem two days ago. Could you please help me?

/infovia/ga/ga004rp0002.actionsurrounded by blanks, and there is"https://tb-infovia.groupwide.net/infovia/ga/ga013rp0004.action?messageId=errors.Authentication.001"; if you're looking for the first, don't you delimit your search regex with spaces so as to pick up the first and not the second.