remove text between delimiters, multiple times on each line

前端 未结 2 2008
星月不相逢
星月不相逢 2021-01-22 07:25

I need to remove text between the delimiters \"<\" and \">\", but there are multiple instances of these on each line of my text file.

For example, I want to turn th

相关标签:
2条回答
  • 2021-01-22 07:49

    If you want to join the dark side, Perl lets you specify non-greedy wildcards with ?:

    perl -pe 's/<.*?>//g' filename.csv
    
    0 讨论(0)
  • 2021-01-22 07:53

    you can use a negated character class in your regex:

    sed 's/<[^>]*>//g' filename.csv
    
    0 讨论(0)
提交回复
热议问题