Regex Only Match After 2nd Forward Slash

3 string examples:




I only want to match the first example. My curent regex matches 1 and 3:


I assume there is a way to make it only match after 2 occurances of a forward slash, but I’ve tried hundreds of search terms and cannot find an example.


Alternatively, doing something like this in MySQL would be sufficient, but I cannot get that working either
LIKE '/%/[0-9]{4}/'

>Solution :

Based on your question, you are not specifying where do you gonna place the regex (Python, Java, C#, etc.)

In a general way, you could try this:

Using the start (^) and end ($) string syntax I place this regex, matching the first case.


Regex101- Example

Leave a Reply