OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

xacml message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Subject: Re: [xacml] regular expressions - subgroup follow-up

On 18 April, bill parducci writes: [xacml] regular expressions - subgroup follow-up
 > regular expressions are acknowledged as being tied to the POSIX (IEEE) 
 > standard. i suggest that we consider basic regular expresssions (BRE) as 
 > defined in POSIX specification 2:
 > http://www.opengroup.org/onlinepubs/007908799/xbd/re.html#tag_007_003
 > there is also an exteded regular expression set:
 > http://www.opengroup.org/onlinepubs/007908799/xbd/re.html#tag_007_004
 > have not really looked through it to discover the differences.

I think I would vote for ERE, due to the "|" metacharacter (RE1 |
RE2) matches RE1 OR RE2, but I don't have a strong preference
either way.

"ed", "grep" use BRE.
"egrep", "awk" use ERE.

Both BRE and ERE support:
. : matches any single character
[xyz] : matches 'x' or 'y' or 'z'
[x-z] : matches any character in the range 'x' - 'z'
(RE)* : matches 0 or more occurrences of RE
        (must be \(RE\)* in BRE)
[:class:] : matches any character in the specified character
        "class", where "class" can be:
        alnum - alpha or numeric
        alpha - alpha
        blank - blank
        cntrl - control char
        digit - 0-9
        lower - lower-case alpha
        upper - upper-case alpha
[^xyz] : matches any character except 'x' or 'y' or 'z'
[^x-z] : matches any character except one in the range 'x' - 'z'

ERE supports the following metacharacters not supported by BRE:
+ : matches 1 or more occurrences of the preceding RE
? : matches 0 or 1 occurrences of the preceding RE
| : specifies that either the preceding or following RE can be
ERE supports anchoring (^ - beginning of line; $ - end of line)
in subexpressions.  BRE supports anchoring only at beginning or
end of the entire expression.
ERE does not support "back references": \n = the nth preceding
subexpression enclosed in \(RE\).

Both BREs and ERE's are supported by the UNIX Regular Expression
Matching interfaces "regcomp(3C)" and "regexec(3C)".

Anne H. Anderson             Email: Anne.Anderson@Sun.COM
Sun Microsystems Laboratories
1 Network Drive,UBUR02-311     Tel: 781/442-0928
Burlington, MA 01803-0902 USA  Fax: 781/442-1692

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Powered by eList eXpress LLC