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
Post a Comment