I'm having troubles with regex. I'm trying to isolate query results that are like :
string1/string2/string3/string4
string1/string2/string3/string4/string5
I want to find the first case from the two above, the one with the chain ending after "string4". I've tryied this regex that doesn't actually works :
$my_regex = "/^(.+)\/(.+)\/(.+)\/(.+)$/";
if (preg_match($my_regex, $category->name)) {
...
}
Am I missing something ?