次のテキスト ファイルを検討してください。
TEST FILE : test #No match
#No match
Run grep "1133*" on this file #Match
#No match
This line contains the number 113. #Match
This line contains the number 13. #No match
This line contains the number 133. #No match
This line contains the number 1133. #Match
This line contains the number 113312. #Match
This line contains the number 1112. #No match
This line contains the number 113312312. #Match
This line contains no numbers at all. #No match
コマンドは正規表現をどのようにgrep
評価しますか?1133*
echo "Consider this text file:
TEST FILE : test #No match
#No match
Run grep \"1133*\" on this file #Match
#No match
This line contains the number 113. #Match
This line contains the number 13. #No match
This line contains the number 133. #No match
This line contains the number 1133. #Match
This line contains the number 113312. #Match
This line contains the number 1112. #No match
This line contains the number 113312312. #Match
This line contains no numbers at all. #No match" | grep "1133*"
出力:
Run grep "1133*" on this file #Match
This line contains the number 113. #Match
This line contains the number 1133. #Match
This line contains the number 113312. #Match
This line contains the number 113312312. #Match
113
行に陽性が含まれているのはなぜですか?
正規表現1133*
は、単語を含むすべての行を検索する以外の意味を持っています1133+anything else
か?
この例は、tldp regexpドキュメント ページで見つかりました。