I have a problem understanding why a submatch is performing the way it does.
Start with: {FIELDA}.getTime()-{FIELDB}-{EXISTING_UNITS_LOST}
Apply this regex: (})([^\.]|$)
Replace using: $1.toDoubleValue()
Gives this: {FIELDA}.getTime()-{FIELDB}.toDoubleValue(){EXISTING_UNITS_LOST}.toDoubleValue()
I want to replace all closing braces that don't already have a '.' after them witha '.toDoubleValue()' so I don't replace the } that already have a method attached, such as '.getTime().
My expression tries to submatch on the '}' and then replace just that using the '$1'. The problem is that the '-' after {FIELDB} disappears even though its outside the submatch.
I use the brilliant RegExp tester at http://www.gskinner.com/RegExr/ to try expressions and I just can't get it to only replace the '}' and not the following 'non-dot' character as well.
Any help much appreciated.