2016-07-14 56 views
1

我有正則表達式模式:SQL匹配正則表達式模式查詢

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

和我有具有subtitle_content列的表;例如,我有一個像下面的示例中的一些記錄:

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 

我想用我的SQL查詢發送此正則表達式,我的查詢帶來字幕的所有內容,但我應該使用哪個查詢只返回與此正則表達式匹配的subtitle_content行? 在這種情況下我想回:

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

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

回答

1
select * from table_name where subtitle_content REGEXP "Regular Expression Here" 
+0

感謝,但此查詢將返回所有記錄包含「正則表達式這裏」 ......我想回到剛纔記錄的行認爲含有這種「常規在這裏表達「 –