Skip to content

Instantly share code, notes, and snippets.

@jeremy-rifkin
Created August 27, 2021 03:33
Show Gist options
  • Save jeremy-rifkin/0016b206cb726471bd44ac86ee44ab56 to your computer and use it in GitHub Desktop.
Save jeremy-rifkin/0016b206cb726471bd44ac86ee44ab56 to your computer and use it in GitHub Desktop.

Revisions

  1. jeremy-rifkin created this gist Aug 27, 2021.
    2 changes: 2 additions & 0 deletions c++numbers.re
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    integer: (?:(?:0[Xx][0-9a-fA-F](?:'?[0-9a-fA-F])*)|(?:0[Bb][01](?:'?[01])*)|(?:0(?:'?[0-7])*)|(?:[1-9](?:'?\d)*))(?:[Uu](?:LL?|ll?|Z|z)?|(?:LL?|ll?|Z|z)[Uu]?)?
    floating-point: (?:((?:\d(?:'?\d)*)?\.\d(?:'?\d)*|\d(?:'?\d)*\.)(?:[Ee][\+-]?\d(?:'?\d)*)?[FfLl]?|\d(?:'?\d)*[Ee][\+-]?\d(?:'?\d)*[FfLl]?|0[Xx](?:(?:[0-9a-fA-F](?:'?[0-9a-fA-F])*)?\.[0-9a-fA-F](?:'?[0-9a-fA-F])*|[0-9a-fA-F](?:'?[0-9a-fA-F])*\.)[Pp][\+-]?\d(?:'?\d)*[FfLl]?|0[Xx][0-9a-fA-F](?:'?[0-9a-fA-F])*[Pp][\+-]?\d(?:'?\d)*[FfLl]?)