Improve regular expression

I want to match something like this in PHP:


However I don't want to match something like this:


I am writing it like this:


I heard regular expression have many features like greedy etc. and they also need to be efficient ? Is the above regualar expression good ?


I wrote a little regex here that captures it like the format you wrote. It might need some slight changes as I didn't know how many digits could be in after class.

class-(\d{2}) #Matches class, makes sure that class only is 2 digits - captures class digits
\/([^\/]{3}) #captures first 3 characters that aren't a slash.
\/([^\/]{3}) #Capture 3 characters again.
\/([^\/]{2}) #captures two characters
\/([^\/]{3}) #Captures 3 characters
\/things_to_remember\/ #Matches last piece of string.

You can test it out here.

Need Your Help

Shiny scoping rules - where to load libraries in modular architecture

r module shiny package

With this question I'm only interested in obtaining some clarity on a best approach to using packages while working with a Shiny app. Despite the fact that, contrary to good practice on asking R-re...

Is it a good idea to make Ansible and Rundeck work together, or using either one is enough?

jenkins ansible continuous-delivery devops rundeck

Recently I'm looking at Ansible and want to use it in projects. And also there's another tool Rundeck can be used to do all kinds of Operations works. I have experience with neither tool and this i...