lib/tag.js
function (str) {
        // here:xx:xxx??inline
        var matches = /^<!--\s*here\:(.*?)\s*-->$/.exec(str.trim())
        if (!matches || !matches[1]) return null
        var expr = matches[1]
        var parts = expr.split('??')
        var query = querystring.parse(parts[1] || '')
        var isInline = ('inline' in query) && query.inline != 'false'
        var isWrapping = query.wrap !== 'false'
        var namespace = ''
        var reg

        expr = parts[0]
        parts = expr.split(':')
        if (parts.length > 1) {
            namespace = parts.shift()
        }
        reg = new RegExp(parts.pop())

        return {
            regexp: reg,          // resource match validate regexp
            namespace: namespace, // resource namespace match
            inline: isInline,      // whether inline resource or not
            wrap: isWrapping
        }
    }
function (str) {
        // here:xx:xxx??inline
        var matches = /^<!--\s*here\:(.*?)\s*-->$/.exec(str.trim())
        if (!matches || !matches[1]) return null
        var expr = matches[1]
        var parts = expr.split('??')
        var query = querystring.parse(parts[1] || '')
        var isInline = ('inline' in query) && query.inline != 'false'
        var isWrapping = query.wrap !== 'false'
        var namespace = ''
        var reg

        expr = parts[0]
        parts = expr.split(':')
        if (parts.length > 1) {
            namespace = parts.shift()
        }
        reg = new RegExp(parts.pop())

        return {
            regexp: reg,          // resource match validate regexp
            namespace: namespace, // resource namespace match
            inline: isInline,      // whether inline resource or not
            wrap: isWrapping
        }
    }
function ( str ) { // here:xx:xxx??inline var matches = / ^<!--\s*here\:(.*?)\s*-->$ / . exec ( str . trim ( ) ) if ( ! matches || ! matches [ 1 ] ) return null var expr = matches [ 1 ] var parts = expr . split ( '??' ) var query = querystring . parse ( parts [ 1 ] || '' ) var isInline = ( 'inline' in query ) && query . inline != 'false' var isWrapping = query . wrap !== 'false' var namespace = '' var reg expr = parts [ 0 ] parts = expr . split ( ':' ) if ( parts . length > 1 ) { namespace = parts . shift ( ) } reg = new RegExp ( parts . pop ( ) ) return { regexp : reg , // resource match validate regexp namespace : namespace , // resource namespace match inline : isInline , // whether inline resource or not wrap : isWrapping } }
Here' tag expression parse functon
Here tag expression parse functon