Mortada Jafar
Mortada Jafar

Reputation: 3679

sql match pattern regex query

I have regex pattern:

Regex: \d+(\d+:\d+:\d+,\d+ --> \d+:\d+:\d+,\d+)\s+?(.+)?word(.+)?

and I have a table which has subtitle_content column; for example, I have some records like the following example:

1
00:00:10,770 --> 00:00:12,670
CHECK YOUR EMAIL FOR THE SECOND MISSION

2
00:00:14,540 --> 00:00:15,740
READ IT ALONE word

3
00:00:45,940 --> 00:00:47,640
WANTED - SECOND word MISSION

I want to send this regex pattern with my SQL query, my query bring all the content of subtitle,but which query should I use to return only the row of subtitle_content which matches to this regex? in this condition I want to return :

00:00:14,540 --> 00:00:15,740
READ IT ALONE word

00:00:45,940 --> 00:00:47,640
WANTED - SECOND word MISSION

Upvotes: 1

Views: 182

Answers (1)

Lovepreet Singh
Lovepreet Singh

Reputation: 4840

select * from table_name where subtitle_content REGEXP "Regular Expression Here"

Upvotes: 1

Related Questions