2016-05-20 60 views
-1

我有一個像下面的原始數據,並希望保持URL鏈接。崇高的文字正則表達式不起作用

> http://www.example.com/routes/en/bus-ticket-from-ipoh-to-alor-setar 
> data:text/javascript;base64,Ly8gSGVyZSBZb3UgY2FuIHR5cGUgeW91ciBjdXN0b20gSmF2YVNjcmlwdC4uLgpjb25zb2x…:5 
> http://www.example.com/routes/en/bus-ticket-from-ipoh-to-alor-setar 
> data:text/javascript;base64,Ly8gSGVyZSBZb3UgY2FuIHR5cGUgeW91ciBjdXN0b20gSmF2YVNjcmlwdC4uLgpjb25zb2x…:5 
> http://www.example.com/routes/en/bus-ticket-from-genting-highlands-to-singapore 
> data:text/javascript;base64,Ly8gSGVyZSBZb3UgY2FuIHR5cGUgeW91ciBjdXN0b20gSmF2YVNjcmlwdC4uLgpjb25zb2x…:5 
> http://www.example.com/routes/en/bus-ticket-from-alor-setar-to-shah-alam 
> data:text/javascript;base64,Ly8gSGVyZSBZb3UgY2FuIHR5cGUgeW91ciBjdXN0b20gSmF2YVNjcmlwdC4uLgpjb25zb2x…:5 

我在正則表達式搜索不匹配的無用塊\:5$,這裏有什麼問題嗎?

+0

發表您嘗試 –

+0

@AvinashRaj我大膽的嘗試我嘗試 –

+0

'行*:5 $'.. ..... –

回答

0

您可以使用下面的正則表達式匹配所有的endsWith :5

.*:5\h* 

DEMO

+0

''5' –

+0

更新後實際上有一個空格................. –

+0

我試過'(?m)。*:5 \ s $它不工作? –