Created
August 27, 2021 03:33
-
-
Save jeremy-rifkin/0016b206cb726471bd44ac86ee44ab56 to your computer and use it in GitHub Desktop.
regular expressions for c++ numeric literals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]?) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment