Possible Duplicates
[Regex to validate UK Post Codes](https://stackoverflow.com/questions/1559757/problem-with-regular-expressions-uk-post-code)

I Need a Regex syntax which accepts the posts codes like the following formates

```
CR03JP
cr03jp
CR0 3JP
cr0 3jp

```

what I have now is 

```
 ^([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]? {1,2}[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)$ 

```

which accepts `CR0 3JP` but rejects `cro3jp CR03JP`

I have tried the following also

```
/((GIR 0AA)|((([A-PR-UWYZ][0-9][0-9]?)|(([A-PR-UWYZ][A-HK-Y][0-9][0-9]?)|(([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY])))) [0-9][ABD-HJLNP-UW-Z]{2}))/i

```

if this has been answered already please point me to the link