regex - MySql REGEXP - how to extract 7 digit value from URL -


i have link (shown below ) field in table values like:

i need extract 7 digit code links. code:

1 - 7 digit not containing character.

2 - contains '/carrier/' , comes 1 section away '/carrier/'.

in above links code 2360283 , 4322830.

please suggest select query regexp.

thanks,

try

$str = 'http://test.abc.com/carrier/ca-9265/2360283/?id=41352626&src=j2w&...';   select substring_index( substring_index($str,'/',-2),'/',1) // return 2360283 

read substring_index more


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -