Hi,
How to match substrings accurately?
eg: I wanted to search whether any pronouns like he, she etc are present in a string say input.
Where is he?
Here I wanted to find whether the pronoun ‘he’ is present. But since the where contains the substring ‘he’ I can’t get the result properly.
I tried with RegExp and arrays and strings; using match(), search() indexOf(). They all do it the same way.
My RegExp pattern is as below:
var pronouns:RegExp = /(i)|(me)|(us)|(he)|(him)|(she)|(her)|(it)|(they)|(them)|(that)/;
I wanted to find for eg, strings like
He is alright
Where is he
She is there
Who is it
I know them
In the above sentences I wanted to get the position of where the pronouns ‘he’ ‘she’ ‘it’ ‘them’ etc occurs.
Why because if it occurs I wanted it to replace them with another words.
Any ideas?
Thanks