RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Python-style integers
Expression
(?i)0b(?:_?[01])+|0o(?:_?[0-7])+|0x(?:_?[0-9a-f])+|[1-9](?:_?\d)*|0(?:_?0)*
Description
A python-style integer, with support for decimal, binary, octal and decimal, and underscore group separator.
Matches
0|1|12|123_456|0b0|0b1|0b01|0o0|0o12|0x0|0x12f
Non-Matches
01|0__1|0b32|0o98|0xhi
Author Rating: Not yet rated. Jeremy Stafford
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials