Regular Expression Function



Hello,

I am not to good with regular expressions and was hoping somebody
could provide me some help to create a function to do the following...

I want a regular expression to compare sentences and then rate them as
a percentage.

IE:

A user types: "Hello, how are you today"

I have an array (or mysql data) with a list of other phrases like so..
1. How are you today
2. Hi, how are you today
3. What is the time
4. What are you doing today
5. Hello how are you today
5. etc

I need the regular expression to compare the string entered by the
user and then return a list from the array rating them as a percentage
of the closest match.

IE: I would assume in this case that number 5 would rate the highest
(100% match) followed by number 2 then number 1.

I don't need to worry about punctuation like commas or quotes etc.
These will be stripped from the input first.

If anybody knows a way to do this it would be greatly appreciated.
Is a regular expression the way to go, or should I be investigating
some other method?

Many thanks!
.



Relevant Pages

  • Regular Expression for comma period dash etc
    ... I'm new to this Regular Expression and need some help. ... restrict what the user types in a text box. ... The User can type only A-Z, a-z, 0-9, spaces, comma, dash, period, ...
    (microsoft.public.dotnet.languages.csharp)
  • Regular Expressions
    ... I am looking for a regular expression for an email address. ... user types in there email address I need to validate it to make sure it has ... a @ and a host ie mydomain.com ...
    (microsoft.public.dotnet.languages.vb)
  • Regular Expressions
    ... I am looking for a regular expression for an email address. ... user types in there email address I need to validate it to make sure it has ... a @ and a host ie mydomain.com ...
    (microsoft.public.dotnet.languages.vb)
  • regExpression Help
    ... I'm trying to get a regular expression that matches only 4 digits, ... If the user types in more than 4 digits it still is being returned as a ... or is my regular expression wrong? ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Regular Expression Function
    ... I want a regular expression to compare sentences and then rate them as ... of the closest match. ... You need a lot more than a regex for this. ...
    (alt.php)