transparencia Posted January 6, 2009 Share Posted January 6, 2009 I'vefound a sample of code that works in a PHP script but not in a regex tool so I presume the regex is not well written. I would like to use with a regex tool or else I will have to create a PHP script to gather all the files and rename them. The regex: /(?<=\w)([[:upper:]])/ The PHP: <? $String="ILoveWeberdev"; $String = preg_replace('/(?<=\w)([[:upper:]])/', ' $1', $String); echo $String ?> Is something wrong? Link to comment https://forums.phpfreaks.com/topic/139637-solved-separate-a-string-by-capital-letters-eg-sonicyouth-becomes-sonic-youth/ Share on other sites More sharing options...
DarkWater Posted January 6, 2009 Share Posted January 6, 2009 /(?<=\w)([A-Z])/ Link to comment https://forums.phpfreaks.com/topic/139637-solved-separate-a-string-by-capital-letters-eg-sonicyouth-becomes-sonic-youth/#findComment-730591 Share on other sites More sharing options...
transparencia Posted January 6, 2009 Author Share Posted January 6, 2009 Solved. Thank you! Link to comment https://forums.phpfreaks.com/topic/139637-solved-separate-a-string-by-capital-letters-eg-sonicyouth-becomes-sonic-youth/#findComment-730597 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.