【发布时间】:2010-01-03 19:50:18
【问题描述】:
我正在尝试使用正则表达式来获取字符串“12344dfdfsss#isa”中 # 后面的内容,在这种情况下,我想从字符串中获取 'isa'。
我发现这些答案 (How to remove a small part of the string in the big string using RegExp) 很有帮助,但它返回的只是“真”。
var myString = '12344dfdfsss#isa',
newRG = new RegExp('#(.*)$'),
trimmed = newTrim.test(myString);
我希望它返回 'isa' 而不是真的。
感谢您的帮助 // 我
【问题讨论】:
标签: javascript trim