Existing dfdl:lengthKind 'pattern' uses the pattern to determine the length. No match means length 0.
People want to use regular expression (or regex) matches differently from this. They want to specify the allowed data patterns, with no match meaning parse error.
This should be added as a dfdlx experimental feature to develop experience with it.
A few design issues: we need to decide if this pattern includes nil values in its syntax, or if those get added as allowed value patterns automatically. It is simpler if we define this to require that the regex pattern specify all possible data patterns that are accepted, whether they become nilled elements, or elements with values. That, however, requires one to redundantly express the dfdl:nilValue information.
There may also be an interaction with properties like dfdl:emptyValueDelimiterPolicy and the empty representation. I.e., does the pattern have to allow for a zero-length successful match in order for the data to be zero-length?