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 RegEx.sub truncating string when end is used #86052

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

TheSofox
Copy link
Contributor

Fixes #55067

When the end argument of RegEx.sub was used, it would truncate the Subject String before even doing the substitution. This fix ensures the end of the subject string is reattached, so that the function works as expected.

@TheSofox TheSofox requested a review from a team as a code owner December 12, 2023 00:08
@akien-mga akien-mga changed the title Fix for RegEx.sub truncating string when 'end' is used Fix for RegEx.sub truncating string when end is used Dec 12, 2023
@akien-mga akien-mga changed the title Fix for RegEx.sub truncating string when end is used Fix RegEx.sub truncating string when end is used Dec 12, 2023
@akien-mga akien-mga added bug topic:core cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release labels Dec 12, 2023
@akien-mga akien-mga added this to the 4.3 milestone Dec 12, 2023
@TheSofox
Copy link
Contributor Author

I've added some Unit Tests for this fix.

@akien-mga akien-mga merged commit 12de2f1 into godotengine:master Feb 20, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 4.2.2.

@akien-mga akien-mga removed the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

End parameter in RegEx.sub removes the end of the input string from the result
2 participants