In the previous study of the comparison of multi-mode, there are forward search, there are back-to-search, there is a positive pattern, there is a negative mode. This time to learn one, is the post-search affirmation mode, meaning that has been scanned the string, but also want to regret to see if you can match. Its syntax is: (? <=pattern). The example below is used to identify the Twitter account, but it will only match and not appear in the matching string, as follows:
#python 3.6# Cai Junsheng #http://blog.csdn.net/caimouse/article/details/51749579#import retwitter = Re.compile ( " ' # A Twitter handle: @username (? <[email protected]) ([\w\d_]+) # username ', re. VERBOSE) Text = "This text includes", Twitter handles. One for @caimouse, and one for the author, @caijunsheng. " Print (text) for match in Twitter.findall (text): print (' Handle: ', match)
The resulting output is as follows:
This text includes the Twitter handles.
One for @caimouse, and one for the author, @caijunsheng.
Handle:caimouse
Handle:caijunsheng
In layman NumPy
http://edu.csdn.net/course/detail/6149
Getting started with Python game developmenthttp://edu.csdn.net/course/detail/5690
you can do it. Modify the C compiler http://edu.csdn.net/course/detail/5582
Card Game Developmenthttp://edu.csdn.net/course/detail/5538 Gobang Game development
http://edu.csdn.net/course/detail/5487
RPG games from beginner to proficient
http://edu.csdn.net/course/detail/5246
Use of the WiX installation tool
http://edu.csdn.net/course/detail/5207
Tetris Game development
http://edu.csdn.net/course/detail/5110
The basics of Boost Library entry
http://edu.csdn.net/course/detail/5029
Introduction to Arduino Basics
http://edu.csdn.net/course/detail/4931
Introduction to unity5.x Game Basics
http://edu.csdn.net/course/detail/4810
TensorFlow API Tips
http://edu.csdn.net/course/detail/4495
TensorFlow Introductory Basic Tutorial
http://edu.csdn.net/course/detail/4369
C + + Standard Template Library from getting started to mastering
http://edu.csdn.net/course/detail/3324
Learn C + + with old rookie
http://edu.csdn.net/course/detail/2901
Learn Python with the old rookie
http://edu.csdn.net/course/detail/2592
Learn to use the TinyXML library in VC2015
http://edu.csdn.net/course/detail/2590
version Management and combat in SVN under Windows
http://edu.csdn.net/course/detail/2579
Basic use of Visual Studio 2015 for developing C + + programs
http://edu.csdn.net/course/detail/2570
using the PROTOBUF protocol in VC2015
http://edu.csdn.net/course/detail/2582
Learn to use MySQL database in VC2015
http://edu.csdn.net/course/detail/2672
A forward-search positive pattern using regular expressions in Python