Does the last pattern work? I think it matches any string with two
consecutive non-spaces, e.g. "AA  AA" ("AA" + two-spaces + "AA").

To prevent multiple spaces I think we probably need something like "([^ ]+
)*[^ ]+" (which replaces the last three patterns).

Do XML regexes support \S (not-whitespace)? If so then I think that "(\S+
)*\S+" covers everything (although also excludes FF and any other
whitespace characters if there are any).

On Thu, 18 Apr 2019 at 05:51, Kent Watsen <[email protected]> wrote:

>
> Many times in models I want a non-empty version of what XSD calls a
> "token":
>
>     token    A string that does not contain line feeds,
>              carriage returns, tabs, leading or trailing
>              spaces, or multiple spaces.
>
> So how about the following?
>
>   typedef token {
>       type string;
>       length "1.max";         // non-empty (some expr do this already)
>       pattern "[^\n\r\t"]+"   // no LFs, CRs, or Tabs
>       pattern "[^ ].*";       // no leading space     (min-length 1?)
>       pattern ".*[^ ]";       // no trailing space    (min-length 1?)
>       pattern ".*[^ ][^ ].*"  // no multiple spaces   (min-length 2?)
>   }
>
> Kent // contributor
>
>
> _______________________________________________
> netmod mailing list
> [email protected]
> https://www.ietf.org/mailman/listinfo/netmod
>
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to