Module re_tuner

Helper function for working with Regular Expression Erlanb re module.

Copyright © 2021 by Anatolii Kosorukov

Authors: Anatolii Kosorukov (java1cprog@yandex.ru) [web site: rustkas.github.io/].

Description

Helper function for working with Regular Expression Erlanb re module.

Data Types

compile_option()

compile_option() = unicode | anchored | caseless | dollar_endonly | dotall | extended | firstline | multiline | no_auto_capture | dupnames | ungreedy | {newline, nl_spec()} | bsr_anycrlf | bsr_unicode | no_start_optimize | ucp | never_utf

mp()

mp() = {re_pattern, term(), term(), term(), term()}

nl_spec()

nl_spec() = cr | crlf | lf | anycrlf | any

Function Index

avoid_characters/0The list of characters which raise an error if escape character is not used.
mp/1It is reduced form of re:compile/1 function.
mp/2It is reduced form of re:compile/1 function.
replace/1Replace one of shorthand pattern from the list [\s,\w,\h,v] in a pattern string.
save_pattern/1Make save Regex pattern which make literal for any character.
tune/1Replace Regex pattern to more siple one.

Function Details

avoid_characters/0

avoid_characters() -> Result

returns: The list of spectial characters.

The list of characters which raise an error if escape character is not used.

mp/1

mp(Regex) -> MP | {error, badarg}

Regex: regex pattern

returns: Opaque data type containing a compiled regular expression

It is reduced form of re:compile/1 function. Return opaque data type containing a compiled regular expression or raise an error badarg.
See also: mp().

mp/2

mp(Regex, Options) -> MP | {error, badarg}

Regex: regex pattern
Options: additional regular expression metadata

returns: Opaque data type containing a compiled regular expression

It is reduced form of re:compile/1 function. Return opaque data type containing a compiled regular expression or raise an error badarg.
See also: mp().

replace/1

replace(Pattern) -> UpdatedPattern

Pattern: searched regex pattern for replacing

returns: Updated Regex pattern string

Replace one of shorthand pattern from the list [\s,\w,\h,v] in a pattern string.

save_pattern/1

save_pattern(Pattern) -> SavePattern

returns: Save pattern

Make save Regex pattern which make literal for any character.

tune/1

tune(Regex) -> Result

returns: Transformed Regex pattern.

Replace Regex pattern to more siple one.


Generated by EDoc