Because of reasons, I'm trying to find a way to do a reg-ex match on the attribute name in a rule condition. The attribute names are of pattern XXyyyyZZZZZZ where XX and ZZZZZZ are constant, but the yyyy part varies. Like:

Code:
 <input>
  <modify class-name="User" qualified-src-dn="\ou=users\cn=bob" src-dn="\users\bob">
   <modify-attr attr-name="XXabcZZZZZZZ">
    <add-value>
     <value type="string">ou=Foo,ou=Bar,ou=Baz</value>
    </add-value>
   </modify-attr>
  </modify>
 </input>
This could be in an <add> or a <modify>, with zero or more operation attributes like XXabcZZZZZZ, XXbcdZZZZZZZ, XXghjZZZZZZZ. I need a true/false match if any of them are in there.

I can specify a single attribute with something like

Code:
(add-attr|modify-attr)[@attr-name="XXabcZZZZZZ"]
but the obvious reg-ex that I'd like to use

Code:
(add-attr|modify-attr)[@attr-name="XX.+ZZZZZ"]
naturally doesn't work.

I've thought of a couple of work arounds that I can probably make work, but they're all kinda ugly and I'm trying to make this change look as simple as possible. It's attempting to replace a whole bunch of rules that do exactly the same thing, but each one has a condition of "if op-attr XXyyyyFoo is changing". It seems like I should be able to reg-ex my way out of this.