lib/compiler.js
function(walk) {
        if (!walk.at('{/')) return false;
        var endIdx = walk.indexOf('}');
        if (endIdx === null)
          return false;
        var source = walk.substring(walk.position, endIdx + 1);
        // Test against the regex
        var m = inputRegexRe.exec(source);
        if (!m) return false;
        // We got an input
        var ctl = this.formCompiler.createCtl('inputRegex');
        try {
          var flags = m[2] || undefined;
          ctl.value = new RegExp('^' + m[1].replace(/^\^/, '').replace(/\$$/, '') + '$', flags);
        } catch(e) {
          return false;
        }
        var size = m[3] && parseInt(m[3].substring(1).trim()) || m[1].length;
        this.out.push('<input');
        this.emitAttrs({
          id: ctl.id,
          name: ctl.id,
          class: ctl.type,
          type: 'text',
          size: size
        });
        this.out.push('/>');
        walk.startFrom(endIdx).skip(2);
        return true;
      }
function(walk) {
        if (!walk.at('{/')) return false;
        var endIdx = walk.indexOf('}');
        if (endIdx === null)
          return false;
        var source = walk.substring(walk.position, endIdx + 1);
        // Test against the regex
        var m = inputRegexRe.exec(source);
        if (!m) return false;
        // We got an input
        var ctl = this.formCompiler.createCtl('inputRegex');
        try {
          var flags = m[2] || undefined;
          ctl.value = new RegExp('^' + m[1].replace(/^\^/, '').replace(/\$$/, '') + '$', flags);
        } catch(e) {
          return false;
        }
        var size = m[3] && parseInt(m[3].substring(1).trim()) || m[1].length;
        this.out.push('<input');
        this.emitAttrs({
          id: ctl.id,
          name: ctl.id,
          class: ctl.type,
          type: 'text',
          size: size
        });
        this.out.push('/>');
        walk.startFrom(endIdx).skip(2);
        return true;
      }
function ( walk ) { if ( ! walk . at ( '{/' ) ) return false ; var endIdx = walk . indexOf ( '}' ) ; if ( endIdx === null ) return false ; var source = walk . substring ( walk . position , endIdx + 1 ) ; // Test against the regex var m = inputRegexRe . exec ( source ) ; if ( ! m ) return false ; // We got an input var ctl = this . formCompiler . createCtl ( 'inputRegex' ) ; try { var flags = m [ 2 ] || undefined ; ctl . value = new RegExp ( '^' + m [ 1 ] . replace ( / ^\^ / , '' ) . replace ( / \$$ / , '' ) + '$' , flags ) ; } catch ( e ) { return false ; } var size = m [ 3 ] && parseInt ( m [ 3 ] . substring ( 1 ) . trim ( ) ) || m [ 1 ] . length ; this . out . push ( '<input' ) ; this . emitAttrs ( { id : ctl . id , name : ctl . id , class : ctl . type , type : 'text' , size : size } ) ; this . out . push ( '/>' ) ; walk . startFrom ( endIdx ) . skip ( 2 ) ; return true ; }
Input regex starts with `{/` marker and ends with `/[flags][, size]}`.
Input regex starts with { / marker and ends with / [ flags ] [ size ] } .