Regex to find text between second and third slashes

后端 未结 6 1955
夕颜
夕颜 2020-11-29 07:48

I would like to capture the text that occurs after the second slash and before the third slash in a string. Example:

/ipaddress/databasename/

I need to capt

6条回答
  •  一生所求
    2020-11-29 08:13

    you can use explode function with PHP or split with other languages to so such operation.

    anyways, here is regex pattern:

    /[\/]*[^\/]+[\/]([^\/]+)/
    

提交回复
热议问题