Selecting part of a field with a regex

后端 未结 2 1239
刺人心
刺人心 2021-01-19 14:24

I\'ve a table where a 3rd party component stores urls, i would like to get only the id parameter from this url.

With PHP i can do it like this:

2条回答
  •  再見小時候
    2021-01-19 14:31

    Is possible to use this package: mysql-udf-regexp

    The functions implemented by this package are:

    REGEXP_LIKE(text, pattern [, mode])
    REGEXP_SUBSTR(text, pattern [,position [,occurence [,mode]]])
    REGEXP_INSTR?(text, pattern [,position [,occurence [,return_end [,mode]]]])
    REGEXP_REPLACE?(text, pattern, replace [,position [,occurence [,return_end [,mode]]])
    

    Very similar to the Oracle SQL functions.

提交回复
热议问题