Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions 12 W7_Q1_ID_Number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Write a program that detects the ID number hidden in a text.
# We know that the format of the ID number is:
# 2 letters, 1 digit, 2 letters, 2 digits, 1 letter, 1 digit (For example: AA4ZA11B1).
#
import re

text = "AABZA1111AEGTV5YH678MK4FM53B6"

pattern = r"\w\w\d\w\w\d\d\w\d"
re.search(pattern, text)
for match in re.findall(pattern, text):
print(match)
20 changes: 20 additions & 0 deletions 20 W7_Q2_8_LettersLong.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Find words that are 8 letter long on this text ;

import re

text = ''' Without, the night was cold and wet, but in the small parlour of Laburnum villa the blinds were
drawn and the fire burned brightly. Father and son were at chess; the former, who possessed ideas
about the game involving radical chances, putting his king into such sharp and unnecessary perils
that it even provoked comment from the white-haired old lady knitting placidly by the fire.
"Hark at the wind," said Mr. White, "who, having seen a fatal mistake after it was too late, was " \
"amiably desirous of preventing his son from seeing it. I'm listening," said the latter grimly surveying the
board as he stretched out his hand. "Check." I should hardly think that he's come tonight," said his father,
with his hand poised over the board. "Mate," replied the son. "That's the worst of living so far out," balled Mr. "
"White with sudden and unlooked-for violence; "Of all the beastly, slushy, out of the way places to live in,
this is the worst. Path's a bog, and the road's a torrent. I don't know what people are thinking about. ' \
'I suppose because only two houses in the road are let, they think it doesn't matter."'''

pattern = r"\s\w{8}\s"
re.search(pattern, text)
for match in re.findall(pattern, text):
print(match)
11 changes: 11 additions & 0 deletions 11 W7_Q3_Email_Address.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Write a program that list according to email addresses without email domains in a text.

import re

text = "The advencements in biomarine studies franky@google.com with the investments necessary and Davos " \
"sinatra123@yahoo.com. Then New Yorker article on wind farms..."

pattern = r"\s\w+@"
re.search(pattern, text)
for match in re.findall(pattern, text):
print(match.strip('@'))
Morty Proxy This is a proxified and sanitized view of the page, visit original site.