I am looking for the Perl Regular Expression to strip part of an HTTP request out.
Basically take the following request examples:
1) GET /index.html HTTP/1.1
2) GET /dir/test.asp?param=value HTTP/1.1
3) POST /dir/dir/dir/test.php HTTP/1.1
4) GET /dir/index.js HTTP/1.1
5) POST /dir/dir/post.asp?param=value HTTP/1.1
6) GET /dir/images/index.jpg HTTP/1.1
7) GET / HTTP/1.1
8) GET /test/script HTTP/1.1
I would like a regular expression that would give me the actual page name. For each one I would like the following to be in Group 1.
I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx..
Use Unix file format while saving Your script.
otherwise it will have ^M s or smth likely weird in the EOL,
Then DO NOT use m…
Email validation in proper way is very important validation required in any web pages.
This code is self explainable except that Regular Expression which I used for pattern matching.
I originally published as a thread on my website : http://www…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions.
Consider email address RFCs:
Look at HTML5 form input element (with type=email) regex pattern: