non printable (moving away from Perl)

Ian Kelly ian.g.kelly at gmail.com
Thu Mar 10 19:25:55 EST 2016


On Mar 10, 2016 5:15 PM, "Fillmore" <fillmore_remove at hotmail.com> wrote:
>
>
> Here's another handy Perl regex which I am not sure how to translate to
Python.
>
> I use it to avoid processing lines that contain funny chars...
>
> if ($string =~ /[^[:print:]]/) {next OUTER;}

Python's re module doesn't support POSIX character classes, but the regex
module on PyPI does.

https://pypi.python.org/pypi/regex



More information about the Python-list mailing list