I’m trying to make CodeIgniter CRUD snippet for Sublime Text 2 and I can’t figure out how to write regex snipet, which will return specific part of the TM_FILEPATH variable
I found this one in one of the CodeIgniter snippets:
${TM_FILEPATH/.+((?:application).+)/$1/:application/controllers/${1/(.+)/\l$1.php/}}
If the file location is for example:
/D/Web/MyApp/application/controllers/admin/user.php
This snippet will return:
application/controllers/admin/user.php
What I need is only the part after “controllers” and without extension, in this example:
admin/user
PS: The path after controllers can have various number of directories, it can be user or also admin/something/user.
1 Answer