fix regular expression to correctly handle argument swapping
add a small unit test suite for some basic tests