BBEdit Grep/Regex 查找并替换破折号后的部分
BBEdit Grep/Regex find and replace part after dash
当我想查找并删除文章编号列中以破折号 (-) 开头的部分以及后面的所有内容时,正则表达式应该是什么样子?
我正在使用 BBEdit 搜索和替换制表符分隔的 CSV 文件(示例如下)中的字符串。
"Article number" "Name" "Third Column"
"Shorts Artic" "Swa..." "2018-07-28"
"Shorts Artic-1" "Swa..." ""
"Shorts Artic-2-1" "Swa..." "https://test-domain.com/..."
"Shorts Artic-2-2-1" "Sw..." ""
"Shorts Artic-2-2-2-2-1" "Ba..." "-asd"
"Shorts Artic-2-2-2-2-2-1" "Nus..."
"Shorts Artic-2-2-2-2-2-1-1" "Lek.."
"0858-1" "Jacket Blue.."
"0858-2-1" "Jacket Re.."
"0858-2-2-1" "Int..."
"0858-2-2-2-1" "In..."
"0858-2-2-2-2-1" "Int..."
"0858-2-2-2-2-2-1" "Int..."
"0858-2-2-2-2-2-2-1" "Int..."
"0858-2-2-2-2-2-2-2-1" "In..."
"0858-2-2-2-2-2-2-2-2" "In..."
"0858-2-2-2-2-2-2-2-1" "In..." "6 107-124 cm"
"stl 31-35-1-1-1-1-2-2-2-1-1" "In..."
"Shorts Artic-1"
会变成 "Shorts Artic"
"Shorts Artic-2-2-1"
会变成 "Shorts Artic"
"0858-2-2-2-2-2-2-2-2"
会变成 "0858"
当我想查找并删除文章编号列中以破折号 (-) 开头的部分以及后面的所有内容时,正则表达式应该是什么样子?
我正在使用 BBEdit 搜索和替换制表符分隔的 CSV 文件(示例如下)中的字符串。
"Article number" "Name" "Third Column"
"Shorts Artic" "Swa..." "2018-07-28"
"Shorts Artic-1" "Swa..." ""
"Shorts Artic-2-1" "Swa..." "https://test-domain.com/..."
"Shorts Artic-2-2-1" "Sw..." ""
"Shorts Artic-2-2-2-2-1" "Ba..." "-asd"
"Shorts Artic-2-2-2-2-2-1" "Nus..."
"Shorts Artic-2-2-2-2-2-1-1" "Lek.."
"0858-1" "Jacket Blue.."
"0858-2-1" "Jacket Re.."
"0858-2-2-1" "Int..."
"0858-2-2-2-1" "In..."
"0858-2-2-2-2-1" "Int..."
"0858-2-2-2-2-2-1" "Int..."
"0858-2-2-2-2-2-2-1" "Int..."
"0858-2-2-2-2-2-2-2-1" "In..."
"0858-2-2-2-2-2-2-2-2" "In..."
"0858-2-2-2-2-2-2-2-1" "In..." "6 107-124 cm"
"stl 31-35-1-1-1-1-2-2-2-1-1" "In..."
"Shorts Artic-1"
会变成 "Shorts Artic"
"Shorts Artic-2-2-1"
会变成 "Shorts Artic"
"0858-2-2-2-2-2-2-2-2"
会变成 "0858"