Skip to main content
added 14 characters in body
Source Link
MiniMax
  • 4.2k
  • 1
  • 21
  • 36
sed 's/\B/\&/g'

\B - Matches everywhere but on a word boundary; that is it matches if the character to the left and the character to the right are either both “word” characters or both “non-word” characters. GNU sed manual.

Information: GNU sed manual, regular expression extensions.

Testing:

sed 's/\B/\&/g' <<< '12345'
1&2&3&4&5
sed 's/\B/\&/g'

\B - Matches everywhere but on a word boundary; that is it matches if the character to the left and the character to the right are either both “word” characters or both “non-word” characters. GNU sed manual.

Testing:

sed 's/\B/\&/g' <<< '12345'
1&2&3&4&5
sed 's/\B/\&/g'

\B - Matches everywhere but on a word boundary; that is it matches if the character to the left and the character to the right are either both “word” characters or both “non-word” characters.

Information: GNU sed manual, regular expression extensions.

Testing:

sed 's/\B/\&/g' <<< '12345'
1&2&3&4&5
formatting
Source Link
αғsнιη
  • 41.9k
  • 17
  • 75
  • 117

sed 's/\B/\&/g'

sed 's/\B/\&/g'

\B - Matches everywhere but on a word boundary; that is it matches if the character to the left and the character to the right are either both “word” characters or both “non-word” characters. GNU sed manual.

Testing:

sed 's/\B/\&/g' <<< '12345'
1&2&3&4&5

sed 's/\B/\&/g'

\B - Matches everywhere but on a word boundary; that is it matches if the character to the left and the character to the right are either both “word” characters or both “non-word” characters. GNU sed manual.

Testing:

sed 's/\B/\&/g' <<< '12345'
1&2&3&4&5
sed 's/\B/\&/g'

\B - Matches everywhere but on a word boundary; that is it matches if the character to the left and the character to the right are either both “word” characters or both “non-word” characters. GNU sed manual.

Testing:

sed 's/\B/\&/g' <<< '12345'
1&2&3&4&5
Source Link
MiniMax
  • 4.2k
  • 1
  • 21
  • 36

sed 's/\B/\&/g'

\B - Matches everywhere but on a word boundary; that is it matches if the character to the left and the character to the right are either both “word” characters or both “non-word” characters. GNU sed manual.

Testing:

sed 's/\B/\&/g' <<< '12345'
1&2&3&4&5