Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasRegex ¶ added in v3.5.0
HasRegex checks if s is enclosed in unescaped forward slashes (e.g. "/pattern/"), consistent with the ModSecurity regex delimiter convention. It returns (true, pattern) where pattern is the content between the slashes. Escaped closing slashes (e.g. "/foo\/") are treated as plain strings and return (false, s).
func MaybeRemoveQuotes ¶
MaybeRemoveQuotes removes the quotes from the string if it begins and ends with them.
func RandomString ¶
RandomString returns a pseudorandom string of length n. It is safe to use this function in concurrent environments. Implementation from https://stackoverflow.com/a/31832326
func UnescapeQuotedString ¶ added in v3.4.0
UnescapeQuotedString unescapes `\"` sequences to `"` in seclang quoted strings. This is the only escape sequence recognized by the seclang quoted string parser — backslashes before any other character (including other backslashes) are left as-is so that operator arguments like regex patterns are passed through unchanged.
func WrapUnsafe ¶
WrapUnsafe wraps the provided buffer as a string. The buffer must not be mutated after calling this function.
Types ¶
This section is empty.