As input parameters I can have two types of String:
codeName=SomeCodeName&codeValue=SomeCodeValue
or
codeName=SomeCodeName
without codeValue.
codeName and codeValue are the keys.
How can I use regular expression to return the key’s values? In this example it would return only SomeCodeName and SomeCodeValue.
I wouldn’t bother with a regex for that. String.split with simple tokens (‘&’, ‘=’) will do the job.