File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
docs-website/reference/haystack-api Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff 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
617617Creates 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
You can’t perform that action at this time.
0 commit comments