Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
PCRE を使用すると、 およびax?aのような文字列を検索できます。aaaxa
ax?a
aa
axa
それを行うgrepの正規表現をどのように記述しますか?
grep default は BRE を使用します。 -P(PCRE) または-E(ERE) オプションを使用できます。
-P
-E
例えば:
kent$ echo "aa axa axxxxa"|grep -E 'ax?a' aa axa
BRE では、文字( ? + ...に特別な意味を持たせるために文字をエスケープする必要があります。
( ? + ...