module test-xpath-re-match {
  yang-version 1.1;

  namespace "http://yuma123.org/ns/test-xpath-re-match";
  prefix trm;

  import ietf-interfaces {
    prefix if;
  }

  organization
    "example.com";

  description
    "Part of the xpath-re-match test.";

  revision 2017-07-16 {
    description
      "Added non-trivial re-match expression";
  }
  leaf test-xpath-re-match-string {
    type string;
    must 're-match("1.22.333","\d{1,3}\.\d{1,3}\.\d{1,3}")';
    must 're-match(.,"\d{1,3}\.\d{1,3}\.\d{1,3}")';
    must 're-match(current(),"\d{1,3}\.\d{1,3}\.\d{1,3}")';

  }

  augment "/if:interfaces/if:interface" {
    leaf count-eth0 {
      type uint32;
      must '/if:interfaces/if:interface[re-match(if:name, "eth0\.\d+")]';
    }
  }
}

