I replaced it now with the regex given. To not get a function call overhead I didn't wrap the regex in a trim function.