LoginSignup
6
6

More than 5 years have passed since last update.

Pythonで正規表現使うとき

Posted at

こんな感じで書く

import re
pattern = re.compile(r'world') #<-regex
match = pattern.search('Hello world!')
if match:
    print 'match string is', match.group()
else:
    print 'match string not found'
#->match string is world

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6