Skip to content

Commit 9632a3e

Browse files
kid1412621jaywcjlove
authored andcommitted
Update sed.md (jaywcjlove#68)
correct error ------------ * Matches a sequence of zero or more instances of matches for the preceding regular expression, which must be an ordinary character, a special character preceded by \, a ., a grouped regexp (see below), or a bracket expression. As a GNU extension, a postfixed regular expression can also be followed by *; for example, a** is equivalent to a*. POSIX 1003.1-2001 says that * stands for itself when it appears at the start of a regular expression or subexpression, but many nonGNU implementations do not support this and portable scripts should instead use \* in these contexts. ref: https://www.gnu.org/software/sed/manual/sed.html
1 parent a7aacef commit 9632a3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

command/sed.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ y # 表示把一个字符翻译为另外的字符(但是不用于正则表达
7878
^ # 匹配行开始,如:/^sed/匹配所有以sed开头的行。
7979
$ # 匹配行结束,如:/sed$/匹配所有以sed结尾的行。
8080
. # 匹配一个非换行符的任意字符,如:/s.d/匹配s后接一个任意字符,最后是d。
81-
** # 匹配0个或多个字符,如:/*sed/匹配所有模板是一个或多个空格后紧跟sed的行。
81+
* # 匹配0个或多个字符,如:/*sed/匹配所有模板是一个或多个空格后紧跟sed的行。
8282
[] # 匹配一个指定范围内的字符,如/[ss]ed/匹配sed和Sed。
8383
[^] # 匹配一个不在指定范围内的字符,如:/[^A-RT-Z]ed/匹配不包含A-R和T-Z的一个字母开头,紧跟ed的行。
8484
\(..\) # 匹配子串,保存匹配的字符,如s/\(love\)able/\1rs,loveable被替换成lovers。

0 commit comments

Comments
 (0)