Showing posts with label Php. Show all posts
Showing posts with label Php. Show all posts

Thursday, April 13, 2017

REGEX | How to extract Path from full Path

Case 1

The case if you want to extract path from a full path directory ex:

D://Folder/Folder/filename.extension

Output

D://Folder/Folder/

Here is a basic example of an inverse regex (finds the filename). Just use the substring before the start to get the path.


[\w]*[.][\w]*$
And the path only:

.*[\\]

Case 2

Case 2 is you get a full path like this


$/Server/First Level Folder/Second_Level_Folder/My File.extension


 this is possible (\$/.*?\.\S*) should do the job just fine.
\$/ matches the start of the path
.*? matches everything till the next part of the regex
\.\S* matches the dot and anything but a whitespace (space, tab)
And the ( ) around it make it capture all that is matched.
EDIT:
For further use
Just the path
(\$/.*?/)[^/]*?\.\S*
Just the filename
\$/.*?/([^/]*?\.\S*)

Tuesday, June 26, 2012

Introduction : Pengenalan fuelPHP, Fitur, Sejarah, dan Tutorial

Introduction : pengenalan fuelPHP

FuelPHP merupakan framework yang di bangun dari bahasa pemrogramman PHP, dan menerapkan konsep HMVC. Framework ini di buat untuk mempermudah para programmer dalam mendevelop website yang berbasis PHP.

Framework FuelPHP awal di buat pada Oktober 2010 oleh Jelmer Schreuder, Dan Horrigan , Harro Verton , Philip Sturgeon dan Frank de Jonge.

Framework Ini di buat dari ide-ide untuk menyempurnakan dari framework-framework yang sudah ada sebelumnya. dengan memperhitungkan orientasi terhadap para developer saat ini.