edsnlp.utils.regex
make_pattern
[source]
Create OR pattern from a list of patterns.
Parameters
PARAMETER | DESCRIPTION |
---|---|
patterns | List of patterns to merge. TYPE: |
with_breaks | Whether to add breaks ( TYPE: |
name | Name of the group, using regex TYPE: |
RETURNS | DESCRIPTION |
---|---|
str | Merged pattern. |
compile_regex
[source]
This function tries to compile reg
using the re
module, and fallbacks to the regex
module that is more permissive.
Parameters
PARAMETER | DESCRIPTION |
---|---|
reg | TYPE: |
RETURNS | DESCRIPTION |
---|---|
Union[Pattern, Pattern] | |