# regex_compile

Definition: | include builtins\regex.e sequence re = regexp_compile(string src)
Description: | Compiles a regular expression (string) into an internal (bytecode) representation ready for execution. This step can be omitted, however if you are going to use a regular expression millions of times it will obviously be faster to do it once at the start. Displays a message or invokes the routine specified via regex_options and returns {} if the regular expression could not be successfully parsed.
pwa/p2js: | Supported.
See Also: | regex
Technicalia | If the regular expression is unanchored, ie does not start with ^, it automatically prepends ".*?" (with RE_DOTMATCHESNL in force) so that the pikevm can apply it in one pass rather than using the O(n2) method of trying from each succesive character position. It likewise replaces the outer loop for the backtrackvm, but in that case it makes no significant difference to the overall performance.