About this deal
This will also work with decimals (123456.78) as long as there aren't too many digits "to the right of the dot" (otherwise you get 123,456.789,012). Of course, the code can easily be extended or changed to handle locale considerations. For example, here is a new version of the code that automatically detects the locale settings and swaps the use of commas and periods. In older versions, JavaScript doesn't support lookbehind, so that doesn't work. Fortunately, we only need to change a little bit: L'Imperatrice Limited Edition, like the original, is composed by perfumer Nathalie Lorson. The new edition retains the main elements of the original composition such as watermelon and cyclamen, with added floral accents of Damask rose and pink peony that replace the jasmine. The base contains additional undertones of smoky woods, with classic notes of sandalwood and musk. The fragrance belongs to the category of floral-fruity perfumes.
Explanation: Assert that from the current position in the string onwards, it is possible to match digits in multiples of three, and that there is a digit left of the current position.