Want to learn?

Regular expressions

Representation

Documentation

Love them or hate them but regular expressions are a huge part of any programming language. In Elixir, regex is based on Perl Compatible Regular Expressions. You can create a regular expression with the following sigil:

~r{regexp}opts
  • regexp - regular expression

  • opts - regular expression options

Options

List of available regexp options:

  • unicode (u) - enables Unicode specific patterns like \p and change modifiers like \w, \W, \s and friends to also match on Unicode. It expects valid Unicode strings to be given on match

  • caseless (i) - adds case insensitivity

  • dotall (s) - causes dot to match newlines and also set newline to anycrlf; the new line setting can be overridden by setting (*CR) or (*LF) or (*CRLF) or (*ANY) according to re documentation

  • multiline (m) - causes ^ and $ to mark the beginning and end of each line; use \A and \z to match the end or beginning of the string

  • extended (x) - whitespace characters are ignored except when escaped and allow # to delimit comments

  • firstline (f) - forces the unanchored pattern to match before or at the first newline, though the matched text may continue over the newline

  • ungreedy (U) - inverts the “greediness” of the regexp (the previous r option is deprecated in favor of U)

Check our latest product - built from our experience helping growing businesses navigate complex compliance requirements without enterprise budgets.

humadroid.io is an affordable, all-in-one GRC platform designed for small and medium-sized businesses pursuing SOC 2 or ISO 27001 compliance. Our AI-powered compliance assistant understands your business context and transforms complex compliance work into actionable steps - generating tailored policy documentation in minutes instead of weeks, and helping draft your SOC 2 System Description in a fraction of the usual time. At just $250/month with no hidden fees or user limits, customers save 10-15 hours per week on compliance work.

Explore humadroid.io
Top

Contact us

* Required fields

The controller of your personal data provided via this contact form is Prograils sp. z o.o., with a registered seat at Sczanieckiej 9A/10, 60-215 Poznań. Your personal data will be processed in order to respond to your inquiries and for our marketing purposes (e.g. when you ask us for our post-development, maintenance or ad hoc engagements for your app). You have the rights to: access your personal data, rectify or erase your personal data, restrict the processing of your personal data, data portability and to object to the processing of your personal data. Learn more.

Notice

We do not track you online. We use only session cookies and anonymous identifiers for the purposes specified in the cookie policy. No third-party trackers.

I understand
Elo Mordo!Elo Mordo!