Specify the Location () ()

team bbl


Specify the Location (^) ($)

You can specify that a string only matches when it occurs at the beginning of a line with circumflex (^). You can specify that a string only matches when it occurs at the end of a line with $.

Regular Expression

Match

Not a Match

^Sir

Sir, Sir John

Dear Sir,

John$

John, Sir John

John Smith

^Sir$

Sir

Dear Sir, Sir John

^.$

a (any line with only one character)

aa (any line with more or less than one character)

^?$

a (any line with zero or one character)

aa (any line with more than one character)

^$

(any blank line)

(any nonblank line)


    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