Match One of a Set of Literal Characters ( )

team bbl


Match One of a Set of Literal Characters ( [ ] )

You can put a set of literal characters inside square brackets. The pattern matches if any one of the set of characters is found. You can indicate a range of characters within the brackets by using a hyphen (-).

NOTE

If you want to include a hyphen as a literal character, include it at the beginning or the end of the set.


Regular Expression

Match

Not a Match

a[bcd]ef

abef, acef, adef

aef, abcef

a[b-d]ef

abef, acef, adef

aef, abcef

a[,.-]b

a,b, a.b, a-b

ab, axb, a,-b

file[1-2][0-9]?

file1, file15, file20

file, file3, file40


    team bbl



    Spring Into Linux
    Spring Into Linux
    ISBN: 0131853546
    EAN: 2147483647
    Year: 2005
    Pages: 362
    Authors: Janet Valade

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net