Hi, Any idea how to get the desired result using regex. some of the numeric field having minus sign at the right hand side.
Want to shift the sign to left side.
Input - Numeric field : 872.68-
Required output : -872.68
Any suggestion..
There might be a way to do this in one go, but I'd probably use some nested RegEx for this:
REGEX_Replace(REGEX_Replace([Field1], '[^\d\.-]', ''),'(\d+\.?\d*)(-)?','$2$1')
The inside RegEx removes anything that's not a digit, period, or dash. Then the outside RegEx moves the dash to the front, if it exists. After looking at my previous answer, I tweaked the inside portion a little to allow for numbers without decimals as well.
Is it formatted as a String because the '-' is at the end? You can do this with a formula.
"-" + Replace([Field1],"-","")
Thanks !! any idea of doing through Regex as well.
@vaibhav_jain
Using a Formula tool:
"-"+trimright([Input],"-")
Using RegEx tool:
Parse: (\d+.\d+)
Replace: -$1
I have attached an example of both. Let me know if you have any questions.
Hi,
I need help with a formula or Regex on how to sepearte the numbers in decimal places and the following senntence which are all in a column. I want them to be in seperate columns rather than same column. Thank you
Example.. The following data is in one column
5.1.1.1 Retrive code from data
5.22.1 Do not retrive code
5.1.2 Retrive code and deposit