Interpreting text

RilleR

Member
Licensed User
Longtime User
Hi all,

I try to build a function to read old SMS and looking for certain words in text to find another word. For example, "My friend Rille Rillesson is from the country of France and has a house in the city Paris". This textmessage would return "France, Paris" as my temp variable. This would be the result of searching for "Country" and pick the word after + searching for "City" and picking "Paris" that follows.


I have searched forums and manuals to try to learn, and have managed to pick up an textmessage from the sms database in phone, showing the result on screen. Now i want to pick those words that i need and my question is..

Should i dig deep into Regex to split the text into an array, then counting words to find what i need ?

OR is it possible to use Matcher to do all work and give me the result, and not get only a "True" or "False" upon finding my word ?


Mybe there are another function that is even better to use, if so please give me a hint or example !

Thanks in advance

/Rille
 

RilleR

Member
Licensed User
Longtime User
You could adapt THIS sample to your needs, or least, it will give you an idea.

Thankyou NjDude, im trying a regex.split first to remove unwanted words and then regex.match to pick the right word :sign0161:

I get the words in hundred combinations besides how i need it..:sign0148: Regex is powerful but also complicated.lol

Tips and ideas would be great :)
 
Upvote 0
Top