0

I have numbers formated like: 1.100.00 and would like to make 1100.00

These numbers are inside a huge line full of characters on each side, comma separated. This is the thing making the solution harded.

Couldn't find something similar to solve this.

2
  • 1
    Have you tried anything? Try here? Aug 4, 2015 at 12:18
  • Try a regex like /\b([\d]+)\.(?=.*\.)\b/g ;).
    – shA.t
    Aug 4, 2015 at 12:21

2 Answers 2

2

I would use the regex below and replace with $1:

(\d+)\.(?!\d{2}\b)

See settings:

enter image description here

If you can have 1 digit in the decimal part, use a limiting quantifier {1,2}:

(\d+)\.(?!\d{1,2}\b)

In case it is overfiring, you can make restrict the pattern to check for the 2 digits after a comma before a space or end of string:

(\d+)\.(?!\d{1,2}(?:\s|$))
1

You could use something like so:

  • Find what: (\d+)\.(\d{3})(\.\d{1,2})?
  • Replace with: \1\2\3
  • Search Mode: Regular Expression

Given this:

1.100.00
2.100.00
3.100.00
4.300.00
3.123.00
1.234.56
1.123

It gets transformed in this:

1100.00
2100.00
3100.00
4300.00
3123.00
1234.56
1123
1
  • Thanks for the help. :) Aug 4, 2015 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.