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

swift - Button on Table View Cell connected to local function -

dns - Dokku server hosts two sites with TLD's, both domains are landing on only one app -

c# - ajax - How to receive data both html and json from server? -