Check if a string value looks like a regex pattern. */
| 2747 | |
| 2748 | /* Check if a string value looks like a regex pattern. */ |
| 2749 | static bool looks_like_regex(const char *s) { |
| 2750 | if (!s) { |
| 2751 | return false; |
| 2752 | } |
| 2753 | return strstr(s, ".*") || strstr(s, ".+") || strchr(s, '[') || strchr(s, '(') || |
| 2754 | strchr(s, '|') || strchr(s, '^') || strchr(s, '$'); |
| 2755 | } |
| 2756 | |
| 2757 | /* Check inline property filters. |
| 2758 | * Values that look like regex patterns are matched with POSIX ERE; |
no outgoing calls
no test coverage detected