我想在Perl中编写一个正则表达式,它将删除字符串中最后一个逗号之后的所有内容.我知道最后一个逗号之后的子字符串是一个数字或其他一些子字符串,所以没有逗号.
示例:some\string,/doesnt-really.metter,5.
我想正则表达式删除最后一个逗号,5所以输出将是:some\string,/doesnt-really.metter
我不允许仅使用正则表达式使用任何其他模块.那么我应该使用哪个正则表达式?
另一个例子:
string_with,,,,,_no_point,some_string => string_with,,,,,_no_point
| 归档时间: |
|
| 查看次数: |
1470 次 |
| 最近记录: |