java - Regular expression to get specific part of request parameter from Log entry? -


i have request parameter in following format

"post /upload/senddata.htm http/1.1"  

and want extract resource name in case upload/senddata.htm

any pointers on how in cases request comes

"post //upload/senddata.htm http/1.1"  

or

"post ///upload/senddata.htm http/1.1"  

i using java

just guess, you're looking for?

post \/+(\w+\/\w+.\w+) 

http://rubular.com/r/iulih9ldzs


or maybe this

post \/+(.+)\s 

http://rubular.com/r/sdw51ek1wi


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -