Improved regex for parameter matching