capture_type(Type)
option passed to re_compile/3,
may be specified using flags if Regex is of the form
Pattern/Flags and may be specified at the level of individual captures
using a naming convention for the caption name. See re_compile/3
for details.
The example below exploits the typed groups to parse a date specification:
?- re_matchsub("(?<date> (?<year_I>(?:\\d\\d)?\\d\\d) - (?<month_I>\\d\\d) - (?<day_I>\\d\\d) )"/e, "2017-04-20", Sub, []). Sub = re_match{0:"2017-04-20", date:"2017-04-20", day:20, month:4, year:2017}.
Options | Only execution options are processed. See re_match/3 for the set of options. Compilation options must be passed as‘/flags` to Regex. |
Regex | See re_match/2 for a description of this argument. |