localstar.blogg.se

Grep ignore case white space
Grep ignore case white space













grep ignore case white space

* is not strictly required I know, I know.) (Notice that there is whitespace (tabs or spaces) in front of the comment, and since it's still a comment, we don't want it!) The regular expression will then succeed to match the remainder of the lines, because the first character at the start of lines 2 and 4 is indeed not a #.īuilding on our success so far, you can also match lines such as: #I am tricky! This regular expression will fail to match the first and third lines, because the first character at the start of lines 1 and 3 is in fact a #, so the part of the regular expression that requires exactly one non- # ( ) fails to match, so grep excludes that line. The net effect is that, if you have a file with contents like the following: #foo

grep ignore case white space

*: Says "Match zero or more of any characters except a newline, for the rest of the line." : Says "Match exactly one character that is not the character #." ^(at position 0 of the regular expression): Says "Match starting at the beginning of a line / the first character immediately following a newline, or the first character of the file itself." '^.*': A regular expression surrounded by single quotes. E: Support extended regular expressions!















Grep ignore case white space