Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing of regex route within namespace #41

Merged
merged 1 commit into from May 17, 2012

Conversation

abackstrom
Copy link
Contributor

Modify parsing of regex routes within namespaces:

  1. Prepend the namespace to all regexes
  2. Interpret circumflex (^) anchor appropriately in relation to namespace
  3. Ensure that negation only matches hits within the namespace

See #40 for original issue and test code.

Slightly wonky aspect of this: the prepending slash.

<?php

with( '/path', function(){
    respond( '@foo', $cb ); // matches /path/foo, /pathfoo, /pathfood, /path/hoofoot
    respond( '@^foo', $cb ); // matches /pathfoo, /pathfood
    respond( '@^/foo', $cb ); // matches /path/foo, /path/food
});

@chriso
Copy link
Contributor

chriso commented May 17, 2012

Thanks. The namespace functionality was a tad rushed.

chriso added a commit that referenced this pull request May 17, 2012
Fix parsing of regex route within namespace
@chriso chriso merged commit 8b7adac into klein:master May 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants