I want a regular expression to test a string that meets the following requirements:
- It may contain
a-z
A-Z
and0-9
- It may contain
-
and_
but may not start nor end with these characters - It may also contain a space but may not start nor end with it
It should match the following strings:
- folder_with some-content
- folderwithcontent
- folder_with_content
- folder-with content
Could someone please help me with it? Thanks in advance!