Thread: Regex in MySql

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2014
    Posts
    1
    Rep Power
    0

    Regex in MySql


    Hello, sorry for my English.
    Please help with pregex in MySql. I want to find two words in text. Between this words can be one or more spaces and/or punctuation mark. For example:
    Tree, apple
    Tree , apple
    Tree ,apple
    Tree , apple
    Tree,apple
    Thanks you!
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Hi,

    what do you need this for? This sounds like a classical violation of the first-normal form.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  4. #3
  5. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,180
    Rep Power
    9398
    If you're doing this for a type of search, use FULLTEXT indexes and MATCH...AGAINST, or go the more sophisticated route and set up a search service that you can query against without having to try to do the actual search stuff yourself.

IMN logo majestic logo threadwatch logo seochat tools logo