Vizible’s Blog

You but me

Posted in Logs by wearetherock on August 13, 2009

Code
======================================
import re
match = re.compile(r’^b([ajk]+$)+’)

isRight = match.findall(‘bajkajkajkajk’)
print isRight
print bool(isRight)

isRight = match.findall(‘baaajjjkkk’)
print isRight
print bool(isRight)

isRight = match.findall(‘bajkb’)
print isRight
print bool(isRight)

isRight = match.findall(‘bkkkjjjjaaaabbbb’)
print isRight
print bool(isRight)

isRight = match.findall(‘bbbajk’)
print isRight
print bool(isRight)

~
Result

======================================
[‘ajkajkajkajk’]
True
[‘aaajjjkkk’]
True
[]
False
[]
False
[]
False
~

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: