I created a java phonebook (desktop app) , on my pc there’s a program that outputs the number of the caller. it’s an 8 digits number.
here’s how it works
I want to crawl only 8 digits numbers from the popup, so lets say this is a popup:
My name is someone like you, i am 22 years old, i was born in 19/10/1989,
my phone number is 34544512
my brother is someone like me he is 18 years old, born in 9101993
his number is 07777666
in this example, i want to crawl 07777666 and 34544512 only.
I want to check the popup window every 2s for new numbers, if a caller calls me twice, his number will be already stored my db and if not I’ll store
Note: if that’s can’t be done, then forget about the popup, lets say it’s just a text being updated every 2 seconds, how to crawl it
This not a homework lol 😀
Use Java regular expressions. Create a regex of 8 or more digits and use it. You will be able to extract these 2 phone numbers from your text sample.