正则表达式获得玉器包括

时间:2013-06-08 17:16:25

标签: javascript regex pug

你能不能给我任何帮助,让jade包含正则表达式。

http://jade-lang.com/

我的代码看起来像这样

html
    body
        .container
           include header.jade
           include body part
           include footer part.jade

Regx应该给出

header.jade
body part
footer part.jade

我试过这个但是它适用于没有空格的文件名,但是包含空格的文件失败了。

/include\s([^\n\s]+)*/g;

2 个答案:

答案 0 :(得分:1)

您只需要将包含一个组与该行的其余部分匹配

/include\s+(.*)/g

答案 1 :(得分:0)

这是你需要的吗?

/include\s{1}[\s\w0-9]+\.jade/;