【发布时间】:2015-01-01 22:20:02
【问题描述】:
我在这个链接上有这个正则表达式示例:http://regexr.com/39rr0
文字输入:1. This camera support Monochrome, Neutral, Standard, Landscape and Portrait!
使用此正则表达式替换字符串时的预期输出:1 This camera support Monochrome Neutral Standard Landscape and Portrait
我正在尝试删除单词后面的标点符号,所以我只得到没有它的单词。
我的正则表达式是(([\S]+)(,|:|;|\?|!)),它在那个正则表达式编辑器中匹配得很好。但是,当我执行string.replace( (([\S]+)(,|:|;|\?|!)), "") 甚至string.find( (([\S]+)(,|:|;|\?|!)) ) 时,它什么也找不到。
执行此操作的正则表达式是什么?我的正则表达式是否损坏或我使用不正确。
【问题讨论】: