Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Using REGEXP in searching

Last post 03-03-2008, 9:18 AM by TobbeK. 0 replies.
Sort Posts: Previous Next
  •  03-03-2008, 9:18 AM 40030

    Using REGEXP in searching

    Anyone having experience in MySQL and REGEXP ? 

     I have 1 input field, named "what"

    Let's say I have the input value "e-mail" and the database field contains the value "email". Is there some way to put some variants into the expression to match values even if the "-" exists or not in the database.

    If the Input is ("e-mail") then I like to match db column value ("email")
    And reverse:
    If the Input is ("email") then I like to match db column value ("e-mail")

    The string "e-mail" is just an example, it can can be any other words, and the hyphen can be anywhere in the word or not.

    Any help or examples is extremely welcome.

    Example code

    what = Request.Form("what")
    WHERE searchwords REGEXP '[[:<:]]"&what&"'"

View as RSS news feed in XML