(\d+(\.|\,|\\|\/|\-)\d+) I have a regex like this. I'm catching numbers like 15.12, 15/15 with this regex it works correctly. But when I get the inverse with the not operator, it doesn't exactly work properly. Regex with "not" operator. [^(\d+(\.|\,|\\|\/|\-)\d+)]
Let's take "15/12 tons/tonne" as the sample text. Here I expect it to find ton/ton, but it doesn't take the "/" character, it just takes tonton. What am I doing wrong ? How can I fix ?
Example;
15/13 48 km/h ---> 48 km/h
13.12 ton. ---> ton.
10,11 ,kwh ---> ,kwh
9-7 .mm. ---> .mm.
As seen in the example, I want to find everything except numbers(including whitespaces).
/ton/ton. Are you saying you want to find slashes, dots, commas etc but only with non-numeric characters surrounding them? And how should the space in the middle be interpreted?