exercism/elixir/log-parser/HINTS.md

3.0 KiB

Hints

General

1. Identify garbled log lines

  • Use the r sigil to create a regular expression.
  • There is an operator that can be used to check a string against a regular expression. There is also a Regex function and a String function that can do the same.
  • Don't forget to escape characters that have special meaning in regular expressions.

2. Split the log line

  • There is a Regex function as well as a String function that can split a string into a list of strings based on a regular expression.
  • Don't forget to escape characters that have special meaning in regular expressions.

3. Remove artifacts from log

  • There is a Regex function as well as a String function that can change a part of a string that matches a given regular expression to a different string.
  • There is a modifier that can make the whole regular expression case-insensitive.

4. Tag lines with user names

  • There is a Regex function that runs a regular expression against a string and returns all captures.