Skip to main content
added 84 characters in body
Source Link
jcubic
  • 10.4k
  • 17
  • 60
  • 80

I'm trying to use sed to remove links like and leave just the title:

## [Some title](#some-title)

This is my command:

sed -i 's/^\(\#*\) *\[\([^\]]*\)\].*/\1 \2/'

I expect to have just the text without the link:

## Some title

But it doesn't work. What I do wrong?

I'm using Linux with GNU sed.

I'm trying to use sed to remove links like and leave just the title:

## [Some title](#some-title)

This is my command:

sed -i 's/^\(\#*\) *\[\([^\]]*\)\].*/\1 \2/'

But it doesn't work. What I do wrong?

I'm trying to use sed to remove links like and leave just the title:

## [Some title](#some-title)

This is my command:

sed 's/^\(\#*\) *\[\([^\]]*\)\].*/\1 \2/'

I expect to have just the text without the link:

## Some title

But it doesn't work. What I do wrong?

I'm using Linux with GNU sed.

Rollback to Revision 1
Source Link
Ed Morton
  • 35.8k
  • 6
  • 25
  • 60

I'm trying to use sed to remove links like and leave just the title:

## [Some title](#some-title)

This is my command:

sed -i 's/^\(\#*\) *\[\([^\]]*\)\].*/\1 \2/'

But it doesn't work. What I do wrong?

I'm trying to use sed to remove links like and leave just the title:

## [Some title](#some-title)

This is my command:

sed 's/^\(\#*\) *\[\([^\]]*\)\].*/\1 \2/'

But it doesn't work. What I do wrong?

I'm trying to use sed to remove links like and leave just the title:

## [Some title](#some-title)

This is my command:

sed -i 's/^\(\#*\) *\[\([^\]]*\)\].*/\1 \2/'

But it doesn't work. What I do wrong?

deleted 3 characters in body
Source Link
Ed Morton
  • 35.8k
  • 6
  • 25
  • 60

I'm trying to use sed to remove links like and leave just the title:

## [Some title](#some-title)

This is my command:

sed -i 's/^\(\#*\) *\[\([^\]]*\)\].*/\1 \2/'

But it doesn't work. What I do wrong?

I'm trying to use sed to remove links like and leave just the title:

## [Some title](#some-title)

This is my command:

sed -i 's/^\(\#*\) *\[\([^\]]*\)\].*/\1 \2/'

But it doesn't work. What I do wrong?

I'm trying to use sed to remove links like and leave just the title:

## [Some title](#some-title)

This is my command:

sed 's/^\(\#*\) *\[\([^\]]*\)\].*/\1 \2/'

But it doesn't work. What I do wrong?

Source Link
jcubic
  • 10.4k
  • 17
  • 60
  • 80
Loading