Re: Parsing/Splitting Line
Noah Rawlins wrote: I'm a nut for regular expressions and obfuscation... import re def splitline(line, size=4): return re.findall(r'.{%d}' % size, line) splitline(helloiamsuperman) ['hell', 'oiam', 'supe', 'rman'] there are laws against such use of regular expressions in certain jurisdictions. /F -- http://mail.python.org/mailman/listinfo/python-list
Re: Parsing/Splitting Line
Fredrik Lundh schrieb: Noah Rawlins wrote: I'm a nut for regular expressions and obfuscation... import re def splitline(line, size=4): return re.findall(r'.{%d}' % size, line) splitline(helloiamsuperman) ['hell', 'oiam', 'supe', 'rman'] there are laws against such use of regular expressions in certain jurisdictions. ... and in particularly bad cases, you will be punished by Perl not less than 5 years ... Georg -- http://mail.python.org/mailman/listinfo/python-list