6 added 15 characters in body
source | link

The pattern [a-z]* matches zero or more characters in the range a to z (the actual characters are dependent on the current locale). There are zero such characters at the very start of the string 123 abc (i.e. the pattern matches), and also four of them at the start of this is a line.

If you need at least one match, then use [a-z][a-z]* or [a-z]\{1,\}, or enable extended regular expressions with sed -E and use [a-z]+.

To visualize where the pattern matches, add parentheses around each match:

$ sed 's/[a-z]*/(&)/' file
()123 abc
(this) is a line

Or, with a repeated matchto see all matches on the lines:

$ sed 's/[a-z]*/(&)/g' file
()1()2()3() (abc)
(this) (is) (a) (line)

Compare that last result with

$ sed -E 's/[a-z]+/(&)/g' file
123 (abc)
(this) (is) (a) (line)

The pattern [a-z]* matches zero or more characters in the range a to z (the actual characters are dependent on the current locale). There are zero such characters at the very start of the string 123 abc (i.e. the pattern matches), and also four of them at the start of this is a line.

If you need at least one match, then use [a-z][a-z]* or enable extended regular expressions with sed -E and use [a-z]+.

To visualize where the pattern matches, add parentheses around each match:

$ sed 's/[a-z]*/(&)/' file
()123 abc
(this) is a line

Or, with a repeated match:

$ sed 's/[a-z]*/(&)/g' file
()1()2()3() (abc)
(this) (is) (a) (line)

Compare that last result with

$ sed -E 's/[a-z]+/(&)/g' file
123 (abc)
(this) (is) (a) (line)

The pattern [a-z]* matches zero or more characters in the range a to z (the actual characters are dependent on the current locale). There are zero such characters at the very start of the string 123 abc (i.e. the pattern matches), and also four of them at the start of this is a line.

If you need at least one match, then use [a-z][a-z]* or [a-z]\{1,\}, or enable extended regular expressions with sed -E and use [a-z]+.

To visualize where the pattern matches, add parentheses around each match:

$ sed 's/[a-z]*/(&)/' file
()123 abc
(this) is a line

Or, to see all matches on the lines:

$ sed 's/[a-z]*/(&)/g' file
()1()2()3() (abc)
(this) (is) (a) (line)

Compare that last result with

$ sed -E 's/[a-z]+/(&)/g' file
123 (abc)
(this) (is) (a) (line)
5 deleted 13 characters in body
source | link

The pattern [a-z]* matches zero or more characters in the range a to z (the actual characters are dependent on the current locale). There are zero such characters at the very start of the string 123 abc (i.e. the pattern matches), and also four of them at the start of this is a line.

If you need at least one match, then use [a-z][a-z]* or enable extended regular expressions with sed -E and use [a-z]+.

To visualize where the pattern matches, add parentheses around each match:

$ sed 's/\([a-z]*\)z]*/(\1&)/' file
()123 abc
(this) is a line

Or, with a repeated match:

$ sed 's/\([a-z]*\)z]*/(\1&)/g' file
()1()2()3() (abc)
(this) (is) (a) (line)

Compare that last result with

$ sed -E 's/([a-z]+)/(\1&)/g' file
123 (abc)
(this) (is) (a) (line)

The pattern [a-z]* matches zero or more characters in the range a to z (the actual characters are dependent on the current locale). There are zero such characters at the very start of the string 123 abc (i.e. the pattern matches), and also four of them at the start of this is a line.

If you need at least one match, then use [a-z][a-z]* or enable extended regular expressions with sed -E and use [a-z]+.

To visualize where the pattern matches, add parentheses around each match:

$ sed 's/\([a-z]*\)/(\1)/' file
()123 abc
(this) is a line

Or, with a repeated match:

$ sed 's/\([a-z]*\)/(\1)/g' file
()1()2()3() (abc)
(this) (is) (a) (line)

Compare that last result with

$ sed -E 's/([a-z]+)/(\1)/g' file
123 (abc)
(this) (is) (a) (line)

The pattern [a-z]* matches zero or more characters in the range a to z (the actual characters are dependent on the current locale). There are zero such characters at the very start of the string 123 abc (i.e. the pattern matches), and also four of them at the start of this is a line.

If you need at least one match, then use [a-z][a-z]* or enable extended regular expressions with sed -E and use [a-z]+.

To visualize where the pattern matches, add parentheses around each match:

$ sed 's/[a-z]*/(&)/' file
()123 abc
(this) is a line

Or, with a repeated match:

$ sed 's/[a-z]*/(&)/g' file
()1()2()3() (abc)
(this) (is) (a) (line)

Compare that last result with

$ sed -E 's/[a-z]+/(&)/g' file
123 (abc)
(this) (is) (a) (line)
4 added 34 characters in body
source | link

The pattern [a-z]* matches zero or more characters in the range a to z (the actual characters are dependent on the current locale). There are zero such characters at the very start of the string 123 abc (i.e. the pattern matches), and also four of them at the start of this is a line.

If you need at least one match, then use [a-z][a-z]* or enable extended regular expressions with sed -E and use [a-z]+.

To visualize where the pattern matches, add parentheses around each match:

$ sed 's/\([a-z]*\)/(\1)/' file
()123 abc
(this) is a line

Or, with a repeated match:

$ sed 's/\([a-z]*\)/(\1)/g' file
()1()2()3() (abc)
(this) (is) (a) (line)

Compare that last result with

$ sed -E 's/([a-z]+)/(\1)/g' file
123 (abc)
(this) (is) (a) (line)

The pattern [a-z]* matches zero or more characters in the range a to z. There are zero such characters at the very start of the string 123 abc (i.e. the pattern matches), and also four of them at the start of this is a line.

If you need at least one match, then use [a-z][a-z]* or enable extended regular expressions with sed -E and use [a-z]+.

To visualize where the pattern matches, add parentheses around each match:

$ sed 's/\([a-z]*\)/(\1)/' file
()123 abc
(this) is a line

Or, with a repeated match:

$ sed 's/\([a-z]*\)/(\1)/g' file
()1()2()3() (abc)
(this) (is) (a) (line)

Compare that last result with

$ sed -E 's/([a-z]+)/(\1)/g' file
123 (abc)
(this) (is) (a) (line)

The pattern [a-z]* matches zero or more characters in the range a to z (the actual characters are dependent on the current locale). There are zero such characters at the very start of the string 123 abc (i.e. the pattern matches), and also four of them at the start of this is a line.

If you need at least one match, then use [a-z][a-z]* or enable extended regular expressions with sed -E and use [a-z]+.

To visualize where the pattern matches, add parentheses around each match:

$ sed 's/\([a-z]*\)/(\1)/' file
()123 abc
(this) is a line

Or, with a repeated match:

$ sed 's/\([a-z]*\)/(\1)/g' file
()1()2()3() (abc)
(this) (is) (a) (line)

Compare that last result with

$ sed -E 's/([a-z]+)/(\1)/g' file
123 (abc)
(this) (is) (a) (line)
3 added 275 characters in body
source | link
2 deleted 3 characters in body
source | link
1
source | link