Skip to content

Instantly share code, notes, and snippets.

@hondajojo
Created September 9, 2015 08:42
Show Gist options
  • Save hondajojo/09d6a804a2a5a9d1e1b6 to your computer and use it in GitHub Desktop.
Save hondajojo/09d6a804a2a5a9d1e1b6 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import re
for i in ['w','1','_','\\','+']:
if re.search(r"[^\w]",i): #^在[]里
print i
# http://www.runoob.com/regexp/regexp-rule.html
# [^a-z] //除了小写字母以外的所有字符
# 在[]里 ^表示
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment