Skip to content

Support \U\u\L\l replace modifiers in global search/replace (see PR #96128)#105101

Merged
roblourens merged 2 commits intomicrosoft:masterfrom
irridia:irridia-feature-regex-caseops
Aug 25, 2020
Merged

Support \U\u\L\l replace modifiers in global search/replace (see PR #96128)#105101
roblourens merged 2 commits intomicrosoft:masterfrom
irridia:irridia-feature-regex-caseops

Conversation

@irridia
Copy link
Copy Markdown
Contributor

@irridia irridia commented Aug 20, 2020

Support \U\u\L\l modifiers to search replacement to alter word case in the global Find/Replace flow.

The behavior is patterned after Boost, but only applied to the replacement text, not subsequent content. Thus the \E isn't relevant. This is also vaguely similar to other replacement syntax, like pcre2 and perl.

For example, to export a file full of non-exported functions in a Go file:
Find:
^func (\w+)(
Replace:
func \u$1(
Example:
func myPrivateFunc(...
Result:
func MyPrivateFunc(...
With \U:
func MYPRIVATEFUNC(...
With \l\l\l\U:
func mypRIVATEFUNC(...

This PR broadens the implemetation as present in PR #96128.

@roblourens

@irridia irridia changed the title Suppert \U\u\L\l replace modifiers in global search/replace (see PR #96128) Support \U\u\L\l replace modifiers in global search/replace (see PR #96128) Aug 20, 2020
@roblourens roblourens assigned roblourens and unassigned rebornix Aug 24, 2020
@roblourens
Copy link
Copy Markdown
Member

I need to spend some more time testing this but at first look it looks great!

Copy link
Copy Markdown
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

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

Thank you!

@roblourens roblourens merged commit e64c80c into microsoft:master Aug 25, 2020
@roblourens roblourens added this to the August 2020 milestone Sep 1, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2020
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.

3 participants