REGEX HELP: SUBDOMAIN CHECK

Posted by NoviceCoding on Stack Overflow See other posts from Stack Overflow or by NoviceCoding
Published on 2010-12-29T06:27:32Z Indexed on 2010/12/29 6:54 UTC
Read the original article Hit count: 257

Filed under:
|
|
|

Hey I have a form where the person enters the subdomain like value.google.com and the entry would be "valid"

I want to run a regex check (I am absolutely horrible at regex) that does the following:

First Character: Cannot be symbol Middle Characters: a-z, A-Z, and symbols - and . ONLY Last character: Cannot be a symbol

I want it to spit out false if it fails the test.

Can anyone help me out with this? Thanks!

Also any other limitations do you guys think should be in there?

© Stack Overflow or respective owner

Related posts about php

Related posts about regex