Hi all.
I'm trying to find a way to insert a white space in the middle of the returned expression.
For example :
8.546.
becomes
8.5 46.
I'm using (\d+\.\d\d\d\.) to match the pattern (it works fine).
My question is how can I insert a white space after the 5 (in that case).l
Tx in advance,
Phil
Find/Replace using Regex
Moderator: General Moderators
Re: Find/Replace using Regex
There are 10 types of people in this world, those who understand binary and those who don't
- prometheuzz
- Forum Regular
- Posts: 779
- Joined: Fri Apr 04, 2008 5:51 am
Re: Find/Replace using Regex
Code: Select all
echo preg_replace('/(\d+\.\d)(\d\d\.)/','$1 $2','8.546.');Re: Find/Replace using Regex
Tx guys for your answers.
I'll try that.
Best regards,
Phil
I'll try that.
Best regards,
Phil