4 ms·
Python, too: http://docs.python.org/library/re.html#re.VERBOSE http://docs.python.org/library/re.html#re.VERBOSE a = re.compile(r"""\d + # the integral par
by peter_l_downs 15y ago
Python, too:
http://docs.python.org/library/re.html#re.VERBOSE http://docs.python.org/library/re.html#re.VERBOSE
a = re.compile(r"""\d + # the integral part
\. # the decimal point
\d * # some fractional digits""", re.X)
b = re.compile(r"\d+\.\d*")
- elijahmanor 15y agoOhh nice, maybe there is where CoffeeScript got inspiration from? The syntax looks very similar.
- berntb 15y agoAfaik Python, like most open source languages, use the PCRE lib, Perl Compatible Regular Expressions. Google it. PCRE isn't as good as Perl's regexps, but not bad. (I've helped people with PCRE problems that worked in Perl.) Edit: I googled myself. :-) The Python lib isn't pcre (anymore), it is something home rolled. The answer to the parent question about inspiration is: Most everyone has copied the Perl syntax (except, irritatingly, Emacs). Edit 2: herge -- Perl is ~ a superset of awk. Use that. (Check -n and -e flags in perldoc perlrun.)
- herge 15y agoVim and awk use the old syntax, and that irritates me to no end.