I am practicing for regular expressions.
I was trying to format numbers using PHP and regex. I want to add comma after each 3 digits like this 111222333444 to this format 111,222,333,444 or 11222333444 to 11,222,333,444 by using PHP and Regular expression.
I searched a lot but I could not find exact solution for this.
I know that there is function in php (number_format) to do this but I want to use Regular expression and PHP to do this because I am learning regex and practicing so I want to use regex and php only.