tags:

views:

64

answers:

4

I need to validate a string that should contain DNS. Which regex is appropiate?

+2  A: 

Using regexlib works wonders!

http://www.regexlib.com/Search.aspx?k=dns

Leom Burke
+1  A: 

It seems someone asks this question yet, try to search before asking see this

ArsenMkrt
+1  A: 

This regex should work: .*DNS.*

Robert Love
Only correct answer! IMMD.
Tim Pietzcker
Yes but I got two down votes on it. :-(
Robert Love
A: 
(?=^.{1,254}$)(^(?:(?!\d+\.|-)[a-zA-Z0-9_\-]{1,63}(?<!-)\.?)+(?:[a-zA-Z]{2,})$)
Svisstack