regexp

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everyone!!!
I want to find all the words in a text that are different from the one i am
looking for by one letter...

It is hard to explain but maybe an example does the job.

For example, i am looking for the word "working"

These findings will be fine

torking worsing workimg workind
warking worting workong etc. etc.

Is there a way to do it? RegExp or any other means!
 
I want to find all the words in a text that are different from the one i
am
looking for by one letter...

The regular expression \w? will match any letter 0 or 1 times.

This regular expression might do what you're looking for:

((\w?orking)|(w\w?rking)|(wo\w?king)|
(wor\w?ing)|(work\w?ng)|(worki\w?g)|(workin\w?))

Greetings,
Wessel
 
If you are looking for a more "generic" approach that will work on any
word, look into algorithms such as soundex and related techniques. I've
seen several C# examples of soundex and related tricks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top