Erlang re docs

Loïc Hoguin essen@REDACTED
Sun Jan 31 10:11:32 CET 2021

On 31/01/2021 00:25, Lloyd R. Prentice wrote:
> Hi Igor,
>> get "compile, inspect, replace, run, split", and that really is pretty much all there is to it. I mean, you write a regex, you compile it, you run it on a string and check the matches.
> You’ve pretty much just written a nice succinct tutorial. Explain why we 
> may  need to compile the regex, e.g. rather than just run the regexp 
> from the parameter field, add well-selected examples for each function, 
> and now we have a document from which one can get the gist with a rapid 
> look up. A footnote pointing to useful details might round it out.

It's already there.

"Compiling the regular expression before matching is useful if the same 
expression is to be used in matching against multiple subjects during 
the lifetime of the program. Compiling once and executing many times is 
far more efficient than compiling each time one wants to match."

Anyway if you think things would be better done another way, send a PR.

Loïc Hoguin

More information about the erlang-questions mailing list