Skip to content

Instantly share code, notes, and snippets.

@JulianLeviston
Created June 8, 2017 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JulianLeviston/10e5a7f7034aa06aad3257b06a12e039 to your computer and use it in GitHub Desktop.
Save JulianLeviston/10e5a7f7034aa06aad3257b06a12e039 to your computer and use it in GitHub Desktop.
Sigil Cheatsheet for Elixir 1.4
sigil_C/2 sigil_D/2 sigil_N/2 sigil_R/2 sigil_S/2 sigil_T/2
sigil_W/2 sigil_c/2 sigil_r/2 sigil_s/2 sigil_w/2
~C is a list of characters, no escaping or interpolation
~c is a list of characters, escaped and interpolated just like a single quoted string
~R is a regular expression with no escaping or interpolation
~r is a regular expression, escaped and interpolated
~S is a string with no escaping or interpolation
~s is a string, escaped and interpolated same as a double quoted string
~W is whitespace-delimited words as a list. No escaping or interpolation
~w is whitespace-delimited words as a list, with escaping and interpolation
~D is a date Date.from_iso8601!/1
~N is a datetime NaiveDateTime.from_iso8601!/1
~T is a time Time.from_iso8601!/1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment