Regex to find text between second and third slashes

后端 未结 6 1965
夕颜
夕颜 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 07:59

    You can even more shorten the pattern by going this way:

    [^/]+/(\w+)
    

    Here \w includes characters like A-Z, a-z, 0-9 and _

    I would suggest you to give SPLIT function a priority, since i have experienced a good performance of them over RegEx functions wherever it is possible to use them.

提交回复
热议问题