upper- to lower-case using sed

前端 未结 7 1020
别那么骄傲
别那么骄傲 2020-12-05 07:21

I\'d like to change the following patterns:

getFoo_Bar

to:

getFoo_bar

(note the lower b)

Knowing

相关标签:
7条回答
  • s/\(get[A-Z][A-Za-z0-9]*_\)\([A-Z]\)/\1\L\2/g
    

    Test:

    $ echo 'getFoo_Bar' | sed -e 's/\(get[A-Z][A-Za-z0-9]*_\)\([A-Z]\)/\1\L\2/g'
    getFoo_bar
    
    0 讨论(0)
提交回复
热议问题