Forum Discussion
jamesdris
Nimbostratus
Nov 24, 2015match regex in payload
iam trying to write a rule to search for a regex for any URL in HTTP::payload, this is what i am using:
when HTTP_REQUEST_DATA {
if { [HTTP::payload] matches_regex {[(https?|ftp):\/\/..]} }
{
HT...
pete_71470
Cirrostratus
Nov 24, 2015The [] pair in a regex matches any single character inside the brackets. So in your example a match is found if the payload contains (, h, t, p, s, etc. Try omitting the square brackets:
[HTTP::payload] matches_regex { (https?|ftp):\/\/.. }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects