Question: i hope someone can help me, how to achieve this.
I have to files with list of data, i am trying to calculate possible permutations between the two lists and save them to a new file. i realized that my output file is very big ( more than 30 Gb ). i would like to know how to make permutation only between the data that meets specific criteria. F.eks if :

Data 1: VHxBxVVxPx255x98x  

Data 2: VHxBxVVxPx255x98x

only permutate if char(6 and 7) from data1 = char(6 and 7) from data2.

my code so far :

```
    fid = fopen( 'file1.txt' );
    cac = textscan( fid, '%20s' );
    fclose( fid );
    num = cac{1};
    fid = fopen( 'file2.txt' );
    cac = textscan( fid, '%20s' );
    fclose( fid );
    str = cac{1};
    fid = fopen( 'file3.txt', 'w' );
    for ii = 1 : length( num )
        for jj = 1 : length( str )
            fprintf( fid, '%1s - %1s\n', num{ii}, str{jj} );
        end
    end   
    fclose( fid );    

```

Answer: 
You don't need regex in your path as long as you use `:pathParam` format on your paths and it will be available within `this.params.pathParam`, namely:

if you are trying to catch those three routes:

```
Router.route('/game/:gameName', function() {
  var acceptablePaths = ["Quarterfinal3", "Semifinal5", "Grandfinal1"],
      gameName = this.params.gameName;
  // check if the game name is one of those that we are looking for
  if ( _.contains(acceptablePath, gameName) ) this.render("notStartedGame");
  // otherwise render a not found template or if you want do something else
  this.render("gameNotFound"); //assuming you have such a template
});

```

or if you are looking for any route that contains "final" in it:

```
Router.route('/game/:gameName', function() {
  var checkFor = "final",
      gameName = this.params.gameName;
  // check if the game name includes "final"
  if ( gameName.indexOf(checkFor) > -1 ) this.render("notStartedGame");
  // otherwise render a not found template or if you want do something else
  this.render("gameNotFound"); //assuming you have such a template
});

```
For future reference (since Meteor can do exactly what you've asked for), [DontVoteMeDown comment](https://stackoverflow.com/questions/26844646/regex-routing-with-iron-router?newreg=07915af8c1ee4d8d9fd2a678fadd5a98#comment42253067_26844646) was right on the spot.

The following route has a fixed part `/game`, followed by a named parameter `/:gameName` based on the regex `.*final\d+`.

```
Router.route('/game/:gameName(.*final\\d+)', function() {
      console.log(this.params.gameName);
})

```

Nice things to note: 

* You don't have to use one *regex* on the whole path. You can use multiple, localized *regexes* intertwined with fixed parts e.g: `/fix1/(.*)/fix2/:reg2(.*)/`. Check out the very nice [path-to-regexp documentation](https://github.com/pillarjs/path-to-regexp).
* You don't have to worry about the paths that do not fit the *regex* - they won't be routed here at all.
* Remember to escape your *regexes* correctly (e.g. note the double backslash)