I'm extracting data from emails. I have pieces of text like this:
Eg. 1: some standard text. Bugs Bunny bugs@gmail.com 0411111111 more standard text
Eg. 2: some standard text. Bugs The Bunny bugs@gmail.com 0411111111 more standard text
Eg. 3: some standard text. Bugs Bunny bugs.bunny@gmail.com 0411111111 more standard text
Eg. 4: some standard text. Bugs bugs.bunny@gmail.com +6141 111 111 more standard text
As you can see, there is a name, email and phone number that I want to extract. The email should be easy enough, and I'm sure I can work out the phone options but how could I get the name?
I know the logic is: get the text after some standard text.
and before the the first non-space-separated string before the @
, but how?
This is my starting point (?<=some standard text. )(.*?)(?=@)
This gives me a result with a group (?<=some standard text. )(.*?)(?:[\w-\.]+)@
so I think I'm on the right path.
I'm using php.