I am trying to write a regex. The condition is that it shouldn't start nor end with a forward slash (/).
^[^/].*[^/]$ is the one I have been trying with. This fails if the string has only one character. How should I get this corrected?
Split the pattern into 2 parts:
You can get something like following:
^[^/](.*[^/])?$
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