내가 만든 코드는아니고 다른사람이 만든거 개조하고있는데 막혀서 질문올림

* 자바스크립트 어제 처음만져봄


var ehDownloadRegex = {

    imageURL: [

        /<a href="(\S+?\/fullimg\.php\?\S+?)"/,

        /<img id="img" src="(\S+?)"/,

        /<\/(?:script|iframe)><a[\s\S]+?><img src="(\S+?)"/ // Sometimes preview image may not have id="img"

    ],

};


여기에서 정규자로 html 링크를 읽어들이는건데

/<a href="(\S+?\/fullimg\.php\?\S+?)"/

이 정규자를 테스터기에 넣으면 이 값을 읽어드림

https://exhentai.org/fullimg.php?gid=000000&page=1&key=000000

이렇게 나온 링크로 다운로드를 하는건데 여기에서 exhentai를 e-hentai로 바꿔서 출력시킬수 있는 방법 없을까?


/<a href="(\S+?\/fullimg\.php\?\S+?)"/ 로 읽어낸 값 중 exhentai 값이 있다면 e-hentai로 바꿔서 출력하도록 하는거임


소스코드

https://github.com/ccloli/E-Hentai-Downloader/blob/master/e-hentai-downloader.user.js