Regardless of `rx`, you need to change the pattern to use string delimiters instead of line delimiters.  Not only in this diff, but actually anywhere in commander where you use `^` and `$` currently.