php - Replace all the first character of words in a string using preg_replace() -


i have string

this sample text. text used dummy "various" regex "operations" using php.

i want select , replace first alphabet of each word (in example : t,i,a,s,t,t,t,w,b,u,a,d,f,",r,",u,p). how do it?

i tried /\b.{1}\w+\b/. read expression "select character has length of 1 followed word of length" didn't work.

you may try regex well:

(?<=\s|^)([a-za-z"]) 

demo


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -