diff --git a/find_ID.py b/find_ID.py new file mode 100644 index 0000000..f7b0781 --- /dev/null +++ b/find_ID.py @@ -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). +AABZA1111AEGTV5YH678MK4FM53B6----->MK4FM53B6 +AEGTV5VZ4PF94B6YH678-------------->VZ4PF94B6 +Author= Bulent Caliskan date= 22/02/2021 +''' + +import re +def get_Id(): + print(((re.findall('\w{2}\d{1}\w{2}\d{2}\w{1}\d{1}',input("enter text? \n"))))[0]) +get_Id() \ No newline at end of file diff --git a/find_email_name.py b/find_email_name.py new file mode 100644 index 0000000..13c9713 --- /dev/null +++ b/find_email_name.py @@ -0,0 +1,14 @@ +''' +Write a program that list according to email addresses without email domains in a text. + +Author= Bulent Caliskan date= 22/02/2021 +input=The advencements in biomarine studies franky@google.com with the investments necessary and Davos sinatra123@yahoo.com. Then New Yorker article on wind farms... +output= franky + sinatra123 +''' +import re + +def find_email_name(): + print(*(i for i in (re.findall('(\S+)@' ,input("enter text?\n ")))),sep='\n') + +find_email_name() \ No newline at end of file diff --git a/find_words.py b/find_words.py new file mode 100644 index 0000000..4cfa575 --- /dev/null +++ b/find_words.py @@ -0,0 +1,20 @@ +''' +Author= Bulent Caliskan date= 22/02/2021 +''' +import re +examp_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."''' +def find_words(text): + print(*(i for i in (re.findall('\s\w{8}\s',text))),sep='\n') + +find_words(examp_text) +