RAVI MISHRA
RAVI MISHRA

Reputation: 141

Data cleaning using regex sql or java

I want to use regex sql to remove all the letters after decimal, like A26.5 H to A26.5, A26.5GH to A26.5, how can I use regex ?

Upvotes: 0

Views: 142

Answers (1)

Mustofa Rizwan
Mustofa Rizwan

Reputation: 10466

You may use this regex in java for each target string:

^([A-Za-z]*\d+(?:\.\d+)?)[\sa-zA-Z]*$

and replace by

$1

Demo

Upvotes: 1

Related Questions