I am pretty new to regular expressions. I need to clean up a search string from spaces at the beginning and the end. Example: \" search string \" Result: \"search string\">
Yep, you should use trim() I guess.. But if you really want that regex, here it is:
((?=^)(\s*))|((\s*)(?>$))