Question: I have a big file with many lines starting like this:

```
22 16052167 rs375684679 A AAAAC . PASS DR2=0.02;AF=0.4728;IMP GT:DS

```

In these lines, `DR2`values range from 0 to 1 and I would like to extract those lines that contains`DR2`values higher than 0.8.

I've tried both `sed` or `awk` solutions, but neither seems to work... I've tried the following:

```
grep "DR2=[0-1]\.[8-9]*" myfile

```

Answer: 
This matches lines with a value greater than *or equal to* 0.8. If you insist on strictly greater than, then I'll have to add some complexity to prevent 0.8 from matching.

```
grep 'DR2=\(1\|0\.[89]\)' myfile

```

The trick is that you need two separate subpatterns: one to match 1 and greater, one to match 0.8 and greater.
* **grep:** `grep -E 'DR2=\([1-9]\|0[.][89]\)'`
* **sed:** `sed -n '/\([1-9]\|0[.][89]\)/p'`
* **awk:** `awk '/\([1-9]\|0[.][89]\)/'`

These 3 solutions are all based on a single regular expression and all do the same (see [Ruud HelderMan's solution](https://stackoverflow.com/a/56019874/8344060))

With awk, however, you could do an artithmetic check if your limits are a bit more tricky. Let's say, I want the value of DR2 to be between 0.53 and 1.39.

```
awk '! match($0,/DR2=/) { next }
     { val = substr($0,RSTART+RLENGTH)+0 }
     ( 0.53 < val) && ( val < 1.39 )'

```