I'm only a month into python and this basic exercise is driving me up the wall. I'm trying to make a search script that will search text I input and put the results on my clipboard. I've been stuck below for about a week. If i copy text directly from a site and input it, no results (I get a None output). But if i copy in the number directly, no problems it reads them perfectly. I've tried it several ways (shown below) and no luck, it has me stumped.Below is a sample text I paste in that gives me no results:
Dr. Someone Spam
Room: BLD-2001
+353 (0)11 123456
Any input people can provide would be great. Also a side question, any books/advice on learning python would be amazing. Currently following "Automate the boring stuff with python". Just doing it for fun. Thanks in advance.
import re, pyperclip
def findphone(numbers):
numregex = re.compile(r'\(\d\)\d\d\s\d+')
numregex1 = re.compile(r'(0)11 123456')
phoneRegex = re.compile(r'''(
(\+\d{3})? # area code
(\s|-|\.)? # separator
(\d{3}|\(\d\)\d\d)? # area code
(\s|-|\.)? # separator
\d{6} # Landline Number
)''', re.VERBOSE)
mo = numregex.search(numbers)
mo0 = numregex1.search(numbers)
mo1 = phoneRegex.search(numbers)
print('mo ' +str(mo))
print('mo0 ' +str(mo0))
print('mo1 ' +str(mo1))
print('Input check text')
numbers = input()
findphone(numbers)