Skip to content

Commit b1239a8

Browse files
authored
Update regex_text_extractor.py (#9894)
1 parent 54ea7ad commit b1239a8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

haystack/components/extractors/regex_text_extractor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(self, regex_pattern: str):
4444
:param regex_pattern:
4545
The regular expression pattern used to extract text.
4646
The pattern should include a capture group to extract the desired text.
47-
Example: '<issue url=\"(.+)\">' captures 'github.com/hahahaha' from '<issue url="github.com/hahahaha">'.
47+
Example: `'<issue url="(.+)">'` captures `'github.com/hahahaha'` from `'<issue url="github.com/hahahaha">'`.
4848
"""
4949
self.regex_pattern = regex_pattern
5050

@@ -66,8 +66,8 @@ def run(self, text_or_messages: Union[str, list[ChatMessage]]) -> dict:
6666
Either a string or a list of ChatMessage objects to search through.
6767
6868
:returns:
69-
- If match found: {"captured_text": "matched text"}
70-
- If no match and return_empty_on_no_match=True: {}
69+
- If match found: `{"captured_text": "matched text"}`
70+
- If no match and `return_empty_on_no_match=True`: `{}`
7171
7272
:raises:
7373
- ValueError: if receiving a list the last element is not a ChatMessage instance.

0 commit comments

Comments
 (0)