[Solved] What could be the regular expression for the text “192.168.71.1 GET HTTP/1.0 /test/abc”?


Using https://regex101.com/ the following works:

192\.168\.71\.1\sGET\sHTTP\/1\.0\s\/test\/abc

Remember to escape special characters like . and \ if you want to use them as literals.

If you want to use any of these characters as a literal in a regex,
you need to escape them with a backslash

Take a look at http://www.regular-expressions.info/characters.html to see more about literal characters and special characters.

Of course, if you’re trying to match any IP address, a different HTTP version or a different request method, you’ll need to specify that in your question so that people can help you more accurately.

There’s some good reads on google, take a look at the preview for safari books online at https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html which has a few example regular expressions for IP addresses. That should get you started!

0

solved What could be the regular expression for the text “192.168.71.1 GET HTTP/1.0 /test/abc”?