Comment #26 on issue 854 by pekka.klarck: Regular expression support for embedded argument syntax
http://code.google.com/p/robotframework/issues/detail?id=854
Well, unfortunately curlies don't work fully. They work when closing curlies match opening curlies, like in `${x:\d{4}}`, but don't when there are unmatched closing curlies like in `${x:[^}]+}`.
The only way to make curlies fully work, at least the only one that I can think of, is requiring closing curlies to be escaped. Above examples should then be written like `${x:\d{4\}}` and ${x:[^\}]+}. I think that's reasonable and also pretty logical thinking how you need to escape other stuff in Robot test data.
An annoying side-effect of escaping would be that escapes needs to be removed at some point which is problematic if backslashes are used also in the actual pattern (which is pretty common as the first example above demonstrates). Probably the only way to resolve that is requiring backslashes to be escaped like in `${x:\\d{4\}}`.
Although escaping backslashes makes specifying the regexp slightly more complicated, it's actually not that bad because you need to escape regexps the same way if you were to use them as positional keyword arguments (e.g. with `Should Match Regex`). This is something I already pointed out in comment 1:
"""Another small detail to think is should we require backslashes in the regexp to be escaped similarly as elsewhere in the test data. It could be that keyword names are handled so that we must require escaping, but it might be more consistent if we would require them even if that wasn't technically necessary."""
It seems now that it is technically necessary to require escaping. Or at least we cannot make curlies work fully without that.
Personally I'm in favor of supporting all functionality (i.e. curlies in this case) and consistent test data syntax (i.e. require regexps to be escaped everywhere). What about others?