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

change regex percent literal delimiter to singlequote #626

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Epigene
Copy link

@Epigene Epigene commented Apr 20, 2024

Curly braces are a part of Regex syntax (.{3,}, .{,9} etc.), so if the literal contains curlybraces, I have to use some other unspecified fallback delimiters. Bikeshedding ensues. Let's use delimiters that are not a part of Regex syntax and are less likely to appear in them - singlequotes. This goes nicely with string literals using doublequotes.

@searls
Copy link
Contributor

searls commented Apr 20, 2024

Though I don't use it myself, my understanding is that %r{} is quite common and popular, so this would be a pretty major change. Additionally, I just scanned the regexes in the app that I'm building and a full third of them contain ' characters, so this would be a pretty disruptive change AFAICT.

Would welcome other perspectives here

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