After testing XML Schema (XSD) regular expressions three times, there really aren't any features that would facilitate this task (in particular, views and bindings), I came up with an approach that seems to work. I used the free space mode to make it easier to read, but this other feature does not support the XSD flavor.
[^ibs].* | i(.{0,1} | [^n].* | n[^t].* | nt.+) | b(.{0,2} | [^y].* | y[^t].* | yt[^e].* | yte.+) | s(.{0,4} | [^t].* | t[^r].* | tr[^i].* | tri[^n].* | trin[^g].* | tring.+)
The first alternative matches any that does not begin with the initial letter of any of the keywords. Each of the other top-level alternatives corresponds to a line that begins with the same letter as one of the keywords, but:
- shorter than the keyword
- has another second letter, another third letter, etc., or
- longer than the keyword.
Note that XSD regular expressions do not support explicit bindings (i.e. ^ , $ , \A , \z ), but all matches are implicitly fixed at both ends.
One potential problem that I see: if the list of keywords is long, you may encounter a restriction on the entire length of the regular expression.
source share