How can I add a space in string at capital letters, but keep continuous capitals together using PHP and a Regex?

前端 未结 1 1939
鱼传尺愫
鱼传尺愫 2021-02-04 07:41

I want to add a space to a string on capital letters using a PHP method like preg_replace() and a regex, but I only want to add a space on the first capital letter

1条回答
  •  不要未来只要你来
    2021-02-04 08:36

    Find:

    (?

    Replace:

     $1
    

    note the space before $1

    Edit: fix.

    0 讨论(0)
提交回复
热议问题