static/js/org/cytoscape.js
function( expectation ){
        var expr;
        var match;
        var name;
        
        for( var j = 0; j < exprs.length; j++ ){
          var e = exprs[j];
          var n = e.name;

          // ignore this expression if it doesn't meet the expectation function
          if( $$.is.fn( expectation ) && !expectation(n, e) ){ continue }

          var m = remaining.match(new RegExp( '^' + e.regex ));
          
          if( m != null ){
            match = m;
            expr = e;
            name = n;
            
            var consumed = m[0];
            remaining = remaining.substring( consumed.length );                
            
            break; // we've consumed one expr, so we can return now
          }
        }
        
        return {
          expr: expr,
          match: match,
          name: name
        };
      }
function( expectation ){
        var expr;
        var match;
        var name;
        
        for( var j = 0; j < exprs.length; j++ ){
          var e = exprs[j];
          var n = e.name;

          // ignore this expression if it doesn't meet the expectation function
          if( $$.is.fn( expectation ) && !expectation(n, e) ){ continue }

          var m = remaining.match(new RegExp( '^' + e.regex ));
          
          if( m != null ){
            match = m;
            expr = e;
            name = n;
            
            var consumed = m[0];
            remaining = remaining.substring( consumed.length );                
            
            break; // we've consumed one expr, so we can return now
          }
        }
        
        return {
          expr: expr,
          match: match,
          name: name
        };
      }
function ( expectation ) { var expr ; var match ; var name ; for ( var j = 0 ; j < exprs . length ; j ++ ) { var e = exprs [ j ] ; var n = e . name ; // ignore this expression if it doesn't meet the expectation function if ( $$ . is . fn ( expectation ) && ! expectation ( n , e ) ) { continue } var m = remaining . match ( new RegExp ( '^' + e . regex ) ) ; if ( m != null ) { match = m ; expr = e ; name = n ; var consumed = m [ 0 ] ; remaining = remaining . substring ( consumed . length ) ; break ; // we've consumed one expr, so we can return now } } return { expr : expr , match : match , name : name } ; }
of all the expressions, find the first match in the remaining text
of all the expressions find the first match in the remaining text