I want to parse the string after the last "/" . For example:
http://127.0.0.1/~dtm/index.php/en/parts/engine
Parse the "engine" .
I tried do it with Regexp but as im new to regexp im stuck near the solution. Also this pattern seems quite easy breakable (/engine/ will break it ) . Need somehow make it a bit more stable.
$pattern = ' \/(.+^[^\/]?) ' ;
- / Match the / char
- .+ Match any char one or more times
- ^[^/\ Exclude \ char