• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 328
  • Last Modified:

MySQL Query: Detect Youtube Link

I want a query like this:  
SELECT * from `Foobar` where (`fulltext` ????????? )

Open in new window

Where results must contain  youtube.com (case insensitive)
  AND results must also contain:
v=<the next charactor should be a letter or a number>

2 Solutions
Please refer following for the searching and indexing with FULLTEXT


Try something similar to following.

SELECT * from `Foobar` where `fulltext` like '%youtube.com%' AND `fulltext` REGEXP ".*v=[0-9].*"

Basically in the REGEXP part we are trying to match string which has any characters before v= and then v= follows with a digit and then can have anything after that.

This REGEXP might have to tweaked for more strict checking.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now