Configuration for regex-based payload extraction.
| 55 | |
| 56 | @dataclass |
| 57 | class RegexEdgeProcessorConfig(EdgeProcessorTypeConfig): |
| 58 | """Configuration for regex-based payload extraction.""" |
| 59 | |
| 60 | pattern: str = "" |
| 61 | group: str | int | None = None |
| 62 | case_sensitive: bool = True |
| 63 | multiline: bool = False |
| 64 | dotall: bool = False |
| 65 | multiple: bool = False |
| 66 | template: str | None = None |
| 67 | on_no_match: str = "pass" |
| 68 | default_value: str | None = None |
| 69 | |
| 70 | FIELD_SPECS = { |
| 71 | "pattern": ConfigFieldSpec( |
| 72 | name="pattern", |
| 73 | display_name="Regex Pattern", |
| 74 | type_hint="str", |
| 75 | required=True, |
| 76 | description="Python regular expression used to extract content.", |
| 77 | ), |
| 78 | "group": ConfigFieldSpec( |
| 79 | name="group", |
| 80 | display_name="Capture Group", |
| 81 | type_hint="str", |
| 82 | required=False, |
| 83 | description="Capture group name or index. Defaults to the entire match.", |
| 84 | ), |
| 85 | "case_sensitive": ConfigFieldSpec( |
| 86 | name="case_sensitive", |
| 87 | display_name="Case Sensitive", |
| 88 | type_hint="bool", |
| 89 | required=False, |
| 90 | default=True, |
| 91 | description="Whether the regex should be case sensitive.", |
| 92 | ), |
| 93 | "multiline": ConfigFieldSpec( |
| 94 | name="multiline", |
| 95 | display_name="Multiline Flag", |
| 96 | type_hint="bool", |
| 97 | required=False, |
| 98 | default=False, |
| 99 | description="Enable multiline mode (re.MULTILINE).", |
| 100 | advance=True, |
| 101 | ), |
| 102 | "dotall": ConfigFieldSpec( |
| 103 | name="dotall", |
| 104 | display_name="Dotall Flag", |
| 105 | type_hint="bool", |
| 106 | required=False, |
| 107 | default=False, |
| 108 | description="Enable dotall mode (re.DOTALL).", |
| 109 | advance=True, |
| 110 | ), |
| 111 | "multiple": ConfigFieldSpec( |
| 112 | name="multiple", |
| 113 | display_name="Return Multiple Matches", |
| 114 | type_hint="bool", |
nothing calls this directly
no test coverage detected