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

Here regex #709

Closed
satyr opened this issue Sep 23, 2010 · 4 comments
Closed

Here regex #709

satyr opened this issue Sep 23, 2010 · 4 comments

Comments

@satyr
Copy link
Collaborator

satyr commented Sep 23, 2010

e.g.:

myurlp = ///
  ^ #{scheme} ://  # aka protocol
    #{host} /      # domain/IP
    #{ paths.join '/' }
    ( \?[^#\s]* )?  # optional query
///

would compile to:

myurlp = RegExp("^" + scheme + "://" + host + "/" + paths.join("/") + "(\\?[^#\\s]*)?")
@akidee
Copy link

akidee commented Sep 23, 2010

Take a look at xregexp's x mode

@jashkenas
Copy link
Owner

I dig it, if you'd like to cook up a patch.

@satyr
Copy link
Collaborator Author

satyr commented Oct 3, 2010

@jashkenas
Copy link
Owner

Heregexes are now merged in to master ... and interpolated regexes are gone. They're pretty fun. Closing the ticket.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants