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

Support \U and \L #7

Open
Sharparam opened this issue Oct 19, 2018 · 5 comments
Open

Support \U and \L #7

Sharparam opened this issue Oct 19, 2018 · 5 comments

Comments

@Sharparam
Copy link
Contributor

Replacement string should have support to convert to lowercase and uppercase via \L and \U like so:

TEST STRING
s/.+/\L\0/
test string

@JuanPotato
Copy link
Contributor

Why not implement as a flag so you can use (?L) and s/.+/\0/L

@Sharparam
Copy link
Contributor Author

Because then you can't apply it to parts of the string.

s/(?<firstname>\w+) (?<lastname>\w+)/\L\g<firstname> \U\g<lastname>/

@Sharparam
Copy link
Contributor Author

@JuanPotato
Copy link
Contributor

JuanPotato commented Oct 20, 2018 via email

@Sharparam
Copy link
Contributor Author

Sharparam commented Nov 2, 2018

Flags really doesn't feel like the way this should be implemented. The lowercase/uppercase modifiers is purely for the replacement string, while flags are for the search string.

And all regex engines I've used implement it as described above, why should it be different 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

No branches or pull requests

2 participants