4 ms·
Python has them: a = re.compile(r"""\d + # the integral part \. # the decimal point \d * # some fraction
by deckiedan 13y ago
Python has them:
a = re.compile(r"""\d + # the integral part
\. # the decimal point
\d * # some fractional digits""", re.X)
- zyxley 13y agoCoffeescript has similar functionality. From the Coffeescript docs: OPERATOR = /// ^ ( ?: [-=]> # function | [-+*/%<>&|^!?=]= # compound assign / compare | >>>=? # zero-fill right shift | ([-+:])\1 # doubles | ([&|<>])\2=? # logic / shift | \?\. # soak access | \.{2,3} # range or splat ) /// When turned into Javascript it becomes: var OPERATOR; OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?\.|\.{2,3})/;
- riffraff 13y agoyes, any decent PL nowadays has it, my point was that it should be the default.