I have tried the following tests with awk: 

Example:  

If I have a file that has: 

```
miz[space][space][end-of-line]  
[empty line]  
pel  

```

If I do: 

```
$ cat mul.txt |awk 'sub(/miz\s+/,"misspell")'  
misspell   

```

awk finds the pattern. 

But if I remove the 2 spaces from the first of the line: 

```
miz[end-of-line]  
[empty line]  
pel  

```

I get:  

`$ cat mul.txt |awk 'sub(/miz\s+/,"misspell")'` 

I.e. awk does not match. 

It seems that there is some subtlety between `$` and `\s` that I fail to understand.  

Also I can not seem to find a way to express a regex that includes a match beyond a `$` but the first snippet works.  

Could someone please explain what is the issue here? 

**Update:**  

This: `$ cat mul.txt |awk 'sub(/miz(\s+|$|^$|^\s+$)+pel/,"misspell")'` does not work either