What would be the appropriate regex to get everything of a sentence except the final word:
For example:
/hello/world -> /hello/
/one/two/three -> /one/two/
/foo/bar/ice/tea -> /foo/bar/ice/
use this regular expression ^/.+/
(.+)\b\w+$
This is fine for all sentences. No matter whether it has / or not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With