Home
Sign Up
Sign In
推荐学习书目
›
Learn Python the Hard Way
Python Sites
›
PyPI
- Python Package Index
›
http://diveintopython.org/toc/index.html
›
Pocoo
值得关注的项目
›
PyPy
›
Celery
›
Jinja2
›
Read the Docs
›
gevent
›
pyenv
›
virtualenv
›
Stackless Python
›
Beautiful Soup
›
结巴中文分词
›
Green Unicorn
›
Sentry
›
Shovel
›
Pyflakes
›
pytest
Python 编程
›
pep8 Checker
Styles
›
PEP 8
›
Google Python Style Guide
›
Code Style from The Hitchhiker's Guide
V2EX
›
Python
新手请教个正则表达式的问题
zncu
·
Mar 20, 2018
· 1483 views
This topic created in 3162 days ago, the information mentioned may be changed or developed.
print(re.findall("(as)|3","3as")) 为什么执行结果是 ['', 'as'] 怎么会出现一个空字符串呢,谢谢
as'
print
字符
请教
1 replies
frostming
Mar 20, 2018
1
1
https://docs.python.org/2/library/re.html#re.findall
If one or more groups are present in the pattern, return a list of groups;
如果有分组则返回分组,你这里有分组,但‘ 3 ’没有分组,所以匹配到了 3,仍返回了一个空
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
1704 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 27ms ·
UTC 16:00
·
PVG 00:00
·
LAX 08:00
·
JFK 11:00
♥ Do have faith in what you're doing.
❯