7.1.3. String matching



String matching applies to string or binary fetch methods, and exists in 6 different forms :

  • exact match (-m str) : the extracted string must exactly match the patterns;
  • substring match (-m sub) : the patterns are looked up inside the extracted string, and the ACL matches if any of them is found inside
  • prefix match (-m beg) : the patterns are compared with the beginning of the extracted string, and the ACL matches if any of them matches.
  • suffix match (-m end) : the patterns are compared with the end of the extracted string, and the ACL matches if any of them matches.
  • subdir match (-m sub) : the patterns are looked up inside the extracted string, delimited with slashes (“/”), and the ACL matches if any of them matches.
  • domain match (-m dom) : the patterns are looked up inside the extracted string, delimited with dots (“.”), and the ACL matches if any of them matches.

String matching applies to verbatim strings as they are passed, with the exception of the backslash (“\”) which makes it possible to escape some characters such as the space. If the “-i” flag is passed before the first string, then the matching will be performed ignoring the case.
In order to match the string “-i”, either set it second, or pass the “–” flag before the first string. Same applies of course to match the string “–“.

Share Button

Leave a Reply