I'm using the following regex code: 

```
^[a-z0-9_-]{3,15}$^

```

I'm using this for username validation and I want it to match alphanumeric characters, `-` , `_` and periods.

The following weird thing happens:

It doesn't match this:

```
bla.b

```

But it matches this one: 

```
bla.blabla

```

How can I change this, so that it matches both? I still would like to be able to change the min and max characters freely. (btw. there maybe more wrong things about this regex. This one I discovered accidentally)

**UPDATE:** I should mention that I'm using this in CakePHP validation and this gives me an error:

```
^[a-z0-9_.-]{3,15}$

```

this is the error: 

```
Warning (2): preg_match() [function.preg-match]: No ending delimiter '^' found

```