Skip to content

Invalid Regex Error? #2

Open
Open

Description

@qwo

Migrating my blog entries and got this stack error from Express

Here are my blog entry names.
https://github.com/stanzheng/gettysburg/tree/stanzheng/content

╭─stanzheng@stanzheng-2  ~/code/norfolkjs/gettysburg  ‹stanzheng›
╰─$ node app.js

/Users/stanzheng/code/norfolkjs/gettysburg/node_modules/express/lib/utils.js:313
  return new RegExp('^' + path + '$', sensitive ? '' : 'i');
                                                       ^
SyntaxError: Invalid regular expression: /^\/[c++-standard-and-education]\/?$/: Range out of order in character class
    at new RegExp (<anonymous>)
    at Object.exports.pathRegexp (/Users/stanzheng/code/norfolkjs/gettysburg/node_modules/express/lib/utils.js:313:56)
    at new Route (/Users/stanzheng/code/norfolkjs/gettysburg/node_modules/express/lib/router/route.js:35:23)
    at Router.route (/Users/stanzheng/code/norfolkjs/gettysburg/node_modules/express/lib/router/index.js:296:15)
    at Router.(anonymous function) [as get] (/Users/stanzheng/code/norfolkjs/gettysburg/node_modules/express/lib/router/index.js:318:16)
    at Function.app.(anonymous function) [as get] (/Users/stanzheng/code/norfolkjs/gettysburg/node_modules/express/lib/application.js:412:26)
    at /Users/stanzheng/code/norfolkjs/gettysburg/app.js:17:11
    at Array.forEach (native)
    at Function._.each._.forEach (/Users/stanzheng/code/norfolkjs/gettysburg/node_modules/underscore/underscore.js:79:11)
    at setRoutes (/Users/stanzheng/code/norfolkjs/gettysburg/app.js:11:7)

Activity

  1. tjwebb commented on Jul 18, 2014

    @tjwebb

    + and - are regex special characters. So those need to be sanitized by the framework, probably via URL encoding.

  2. qwo commented on Jul 18, 2014

    @qwo
    Author

    agreed i'll follow the stack trace and issue a PR to fix this tonight. Put this effort on the backburner.

    SN: @tjwebb do you think theres an easy way to generate static files and stash them in a directory? I'm still very use to publishing to github pages and would be up for putting a PR for users to publish static pages to github.

    **through express and how the framework is architected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions