I have 2 wee problems with this.

How can I also check for sinle and double speach marks ?
How does javascript handle these and what is the "g" for ?