Commit e0ad2501 authored by 李维's avatar 李维

修改正则表达式

parent 168093e9
......@@ -389,7 +389,7 @@ export default class Cartoon {
playAudio(audio_url, cb = null) {
return new Promise((resolve, reject)=>{
if (audio_url) {
var urlreg=/^(?=^.{3,255}$)(http(s)?:\/\/)?(www\.)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\d+)*(\/\w+\.\w+)*([\?&]\w+=\w*)*$/
var urlreg=/(?:(http|https|ftp):\/\/)?((?:[\w-]+\.)+[a-z0-9]+)((?:\/[^/?#]*)+)?(\?[^#]+)?(#.+)?$/
if(urlreg.test(audio_url)) {
cc.assetManager.loadRemote(audio_url, (err, audioClip) => {
if(cb) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment