日期:2014-05-16 浏览次数:20449 次
alert('北京(今日)【E】/二环(活动)【B】'.replace(/([\s\S]*?)
------解决方案--------------------
【[\s\S]*?】/g,''));//北京/二环
alert('345D大B0成-24/美'.replace(/\/.*/g,'').match(/[\u4e00-\u9fa5]/g).join(''));//大成
alert('345D大B0成-24/美'.replace(/\/.*/g,'').match(/\d/g).join(''));//345024
alert('345D大B0成-24/美'.replace(/\/.*/g,'').match(/[a-z]/ig).join(''));//DB
alert('345D大B0成-24/美'.replace(/\/.*/g,'').match(/[a-z\d]/ig).join(''));//
alert('美/345D大B0成-24'.replace(/.*\//g,'').match(/[\u4e00-\u9fa5]/g).join(''));//大成
alert('美/345D大B0成-24'.replace(/.*\//g,'').match(/\d/g).join(''));//345024
alert('美/345D大B0成-24'.replace(/.*\//g,'').match(/[a-z]/ig).join(''));//DB
alert('美/345D大B0成-24'.replace(/.*\//g,'').match(/[a-z\d]/ig).join(''));//345DB024
alert("北京(今日)【E】/二环(活动)【B】".replace(/(.+?)
------解决方案--------------------
【.+?】/g,""));
alert("345D大B0成-24/美".replace(/\/.*?$/,"").replace(/[\x00-\xff]/g,""));
alert("345D大B0成-24/美".replace(/\/.*?$/,"").replace(/\D/g,""));
alert("345D大B0成-24/美".replace(/\/.*?$/,"").replace(/[^a-z]/ig,""));
alert("345D大B0成-24/美".replace(/\/.*?$/,"").replace(/[^a-z\d]/ig,""));
alert("美/345D大B0成-24".replace(/^.*?\//,"").replace(/[\x00-\xff]/g,""));
alert("美/345D大B0成-24".replace(/^.*?\//,"").replace(/\D/g,""));
alert("美/345D大B0成-24".replace(/^.*?\//,"").replace(/[^a-z]/ig,""));
alert("美/345D大B0成-24".replace(/^.*?\//,"").replace(/[^a-z\d]/ig,""));