我正在尽我最大的努力设计一个聊天工具,我希望它能找到soundcloud链接,并把它们变成一个可以播放这首歌的播放器。我知道如何使用他们的播放器应用程序接口,但我的RegExp无法正常工作。
我的代码:/https:\/\/soundcloud\.com\//gi只查找SoundCloud位,但我还希望它查找斜杠后面的所有内容,直到它到达空格。
发布于 2013-12-08 00:53:15
but I also want it to find everything that comes after the slash until it hits whitespace.
您可以使用THen:
/https?:\/\/soundcloud\.com\/\S*/gi在https://soundcloud.com/段之后,\S*将匹配0个或更多非空格字符
https://stackoverflow.com/questions/20443908
复制相似问题