I have a document with lines containing email addresses and IP addresses. I need to split the document in terms of email addresses and IP addresses to store each IP/email address or words in the file in an array.
Is there a way to use regex/String Tokenizer to find email/IP address to do this? I am aware of how regex/String Tokenizer can be used to separate words in a sentence line by line. Just not sure how to find email/IP addresses. Because the file may contain illegal characters like @ \ // which should not be included in the array.
For example my document contains:
You can contact test@test.com, the address is 192.168.1.1.
My array should contain:
You
can
contact
test@test.com
the
address
is
192.168.1.1