Welcome~~~


Another blog:
http://fun-st.blogspot.com/

It is easier to write an incorrect program than understand a correct one.

Wednesday, February 9, 2011

# Finding the phone numbers in 50,000 HTML pages

egrep "(([0-9]{1,2}.)?[0-9]{3}.[0-9]{3}.[0-9]{4})" -R *.html



egrep [options] [regexp] [files]
Search one or more files for lines that match an extended regular expression regexp.

$ grep 'paper | people' fortunes.txt            ----> do not support
$ egrep 'paper | people' fortunes.txt            ---->support


In the first example, grep doesn’t support logical ORings of regular expressions (as the pipe character in quotes denotes match the first or match the next; and so forth)
As demonstrated in the second example, egrep supports logical ORing.
REMEMBER: The speed of a grep command’s execution is predicated upon the complexity of the pattern match; or regular expression defined!

♥ ¸¸.•*¨*•♫♪♪♫•*¨*•.¸¸♥
http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.cmds/doc/aixcmds2/egrep.htm
http://www.oreillynet.com/linux/cmd/cmd.csp?path=e/egrep
http://uniforumchicago.org/slides/regexp/sld008.htm 

No comments:

Post a Comment