List Info

Thread: Regex for possible misspellings in a word




Regex for possible misspellings in a word
country flaguser name
United States
2007-10-10 21:04:27
Hi,

I wondered if theres a way to make this regex more compact
or better.
I want to check for possible misspellings in a word. For
example to
match misspellings for "knot" were one character
is wrong. So:

((k|w)not)|(k(n|w)ot)|(kn(o|w)t)|(kno(t|w))

Is there a better way?

Thanks,
Lee G.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---


Re: Regex for possible misspellings in a word
user name
2007-10-10 21:09:02


On 10/11/07, leegold58 < goldtechworldpost.com">goldtechworldpost.com> wrote:

Hi,

I wondered if theres a way to make this regex more compact or better.
I want to check for possible misspellings in a word. For example to
match misspellings for "knot" were one character is wrong. So:

((k|w)not)|(k(n|w)ot)|(kn(o|w)t)|(kno(t|w))
&nbsp;
does this regex equal to &nbsp; (wnot)|(kwot)|(knwt)|(know) ; &nbsp; ??

Is there a better way?

Thanks,
Lee G.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/regex
-~----------~----~----~----~------~----~------~--~---

Re: Regex for possible misspellings in a word
country flaguser name
United States
2007-10-10 22:48:50

> > ((k|w)not)|(k(n|w)ot)|(kn(o|w)t)|(kno(t|w))
>
> does this regex equal to  
(wnot)|(kwot)|(knwt)|(know)    ??
>

Yes. Thank you.

I wonder if there's a way to make it even shorter?



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---


Re: Regex for possible misspellings in a word
user name
2007-10-10 23:23:01
regular expression is context-free grammar,
so I think it's not the best way to solve your problem

&nbsp;
On 10/11/07, leegold58 < goldtechworldpost.com">goldtechworldpost.com> wrote:


> > ((k|w)not)|(k(n|w)ot)|(kn(o|w)t)|(kno(t|w))
>
> does this regex equal to &nbsp; (wnot)|(kwot)|(knwt)|(know) ; &nbsp; ??
>

Yes. Thank you.

I wonder if there's a way to make it even shorter?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/regex
-~----------~----~----~----~------~----~------~--~---

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )