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 transformation of regex with lookahead/lookbehind #796

Merged

Conversation

bolshakov
Copy link

Fixes transformation of lookbehind/lookahead.

Before fix:

transform(/^xy(?=z)/).to_s) #=> "xy(?:?=z)"

After fix

transform(/^xy(?=z)/).to_s) #=> "xy(?=z)"

It works for positive/negative lookahead/lookbehind and for named capture groups

@@ -9,6 +9,26 @@ def transform(regexp)
end

describe "#to_s" do
it "do not touch positive lookahead captures" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to be petty, but could you change these to read it "does not touch..." - that would be better English! 😄

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, thank you!

@bolshakov bolshakov force-pushed the feature/lookahead_transformation branch from cd0920c to 8ddf35a Compare January 29, 2015 08:11
@bolshakov
Copy link
Author

@mattwynne spelling fixed

mattwynne added a commit that referenced this pull request Jan 29, 2015
Fix transformation of regex with lookahead/lookbehind
@mattwynne mattwynne merged commit c0e2174 into cucumber:master Jan 29, 2015
@mattwynne
Copy link
Member

Spasibo!

@bolshakov
Copy link
Author

Рад помочь :)

@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants