Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

Explain the code

$
0
0

@shivagolla1 wrote:

Can someone please explain the pattern given in match() function.
import re
li=[‘9999999999’,‘999999-999’,‘99999x9999’]
for val in li:
if re.match(r’[8-9]{1}[0-9]{9}’,val) and len(val) == 10:
print ‘yes’
else:
print ‘no’
Output:
yes
no
no

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles