Regex capitalize first letter every word, also after a special character like a dash

后端 未结 6 915
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 08:21

I use this #(\\s|^)([a-z0-9-_]+)#i for capitalize every first letter every word, i want it also to capitalize the letter if it\'s after a special mark like a da

6条回答
  •  既然无缘
    2020-11-29 08:33

    Actually dont need to match full string just match the first non-uppercase letter like this:

    '~\b([a-z])~'
    

提交回复
热议问题