Skip to content

Commit 93edaeb

Browse files
Sync Haystack API reference on Docusaurus (#10178)
Co-authored-by: anakin87 <[email protected]>
1 parent 85c27dc commit 93edaeb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs-website/reference/haystack-api/extractors_api.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ result = parser.run(text_or_messages=messages)
611611
#### RegexTextExtractor.\_\_init\_\_
612612

613613
```python
614-
def __init__(regex_pattern: str)
614+
def __init__(regex_pattern: str, return_empty_on_no_match: bool = True)
615615
```
616616

617617
Creates an instance of the RegexTextExtractor component.
@@ -643,6 +643,7 @@ Extracts text from input using the configured regex pattern.
643643

644644
**Returns**:
645645

646-
- If match found: `{"captured_text": "matched text"}`
647-
- If no match and `return_empty_on_no_match=True`: `{}`
646+
- `{"captured_text": "matched text"}` if a match is found
647+
- `{}` if no match is found and self.return_empty_on_no_match=True (default behavior)
648+
- `{"captured_text": ""}` if no match is found and self.return_empty_on_no_match=False
648649

0 commit comments

Comments
 (0)