I am having some trouble figuring out the look-behind in Python. More specifically I have this piece of text which has dates in `(mm/dd/yyyy)` `(mm-dd-yyyy)` formats and just the years in `(yyyy)` formats :

```
Jan-01-2001
Jan 01 2001
2003 2007
The year was 2009 when x decided to work for Google

```

What is the best way of matching to just extract the lines which have the `yyyy`. I should be able to extract `2003` , `2007` and `2009` but not any other dates like the `Jan-01-2001` and `Jan 01 2001`. I tried the *lookbehind* operator and the best I could come with was `((?<!(-| ))\d{4})`. But this selects only `2003` and **not** `2007` and `2009`. I also tried using *groups* to define a date pattern and use them in conjunction with *lookbehind*, but that did not work. What would be the right and efficient way of doing this in regular expressions (Python)