正则表达式提取第一个文件名

时间:2018-04-14 21:43:54

标签: regex file url expression extract

我想从此网址中提取第一个文件名: Endless_Curse _-_ CE_v1.0.zip

[URL = https://google.com/fjhbqp5o5w06/Endless_Curse_-_CE_v1.0.zip]Endless诅咒 - CE v1.0.zip - 10.4 MB [/ URL]

1 个答案:

答案 0 :(得分:0)

function init() {

    var scene = new THREE.Scene();

    var box = getBox(1, 1, 1);

    scene.add(box);

    var camera = new THREE.Camera(45, window.innerWidth/window.innerHeight, 1, 1000 );
    //camera.position.z = 2;

    var renderer = new THREE.WebGLRenderer();

    renderer.setSize(window.innerWidth, window.innerHeight);
    document.getElementById("webgl").appendChild(renderer.domElement);

    renderer.render(scene, camera);
}

function getBox(w, h, d) {
    var geometry = new THREE.BoxGeometry(w, h, d);
    var material = new THREE.MeshBasicMaterial({
        color : 0x00ff00
    });

    var mesh = new THREE.Mesh(geometry, material);

    return mesh;
} 

init();

第二组将是您的文件名:http://regex101.com/r/ehU7Ci/1

{{1}}

这会将您的文件名与https://regexr.com/3nu8j

中的第2组进行匹配