mirror of
https://github.com/rjNemo/exercism-elixir
synced 2026-06-06 02:16:48 +00:00
2.6 KiB
2.6 KiB
Hints
General
- Review regular expression patterns from the introduction. Remember, when creating the pattern a string, you must escape some characters.
- Read about the
Regexmodule in the documentation. - Read about the regular expression sigil in the Getting Started guide.
- Check out this website about regular expressions: Regular-Expressions.info.
- Check out this website about regular expressions: Rex Egg -The world's most tyrannosauical regex tutorial.
- Check out this website about regular expressions: RegexOne - Learn Regular Expressions with simple, interactive exercises..
- Check out this website about regular expressions: Regular Expressions 101 - an online regex sandbox.
- Check out this website about regular expressions: RegExr - an online regex sandbox.
1. Match the day, month, and year from a date
- Remember to return a string representing the regular expression pattern.
- Review how to create character classes or use shorthand character classes.
- Review quantifiers.
- A day is one or two digits.
- A month is one or two digits.
- A year is four digits.
2. Match the day of the week and the month of the year
- Review how to write a pattern to match string literals.
- Review alternations.
- Wrap the whole expression in a group.
3. Capture the day, month, and year
- Review how to write patterns for captures and named captures.
- Reuse the
day/0,month/0,year/0,day_names/0, andmonth_names/0functions that you already implemented.
4. Combine the captures to capture the whole date
- Remember, string interpolation may be used to join strings.
- Reuse the
capture_day/0,capture_month/0,capture_year/0,capture_day_name/0, andcapture_month_name/0functions that you already implemented.
5. Narrow the capture to match only on the date
- Remembers, anchors help to match the pattern to the whole line.
- String interpolation may be used in the regular expression sigil syntax.
- Reuse the
capture_numeric_date/0,capture_month_name_date/0, andcapture_day_month_name_date/0functions that you already implemented.