Hello All,
I have two strings one is valid and another is not valid i need read only valid xml files for loading,so kindly help me with a regular expression which validates the string and tells as valid /Invalid.
string faString1 = "FA557_740Lxe.xml"; [Valid]
string faString2 = "FAlist_G31.xml"; [InValid]
Thank you
Loading

Munesh SharmaRank #174 · 13.9K reputationPosted Apr 2, 2014, 10:51 PM EDT
Abhay ShankerRank #375 · 6.7K reputationPosted Apr 2, 2014, 11:08 PM EDT
sampath meka39 reputationPosted Apr 2, 2014, 11:31 PM EDT
kindly help me to write a regex for this
Thank you
sampath meka39 reputationPosted Apr 2, 2014, 11:32 PM EDT
kindly help me to write a regex for this
Thank you
Munesh SharmaRank #174 · 13.9K reputationPosted Apr 3, 2014, 12:30 AM EDT
the regular expression is
regex rx = new regex("^[a-zA-Z]{2,2}[0-9]{3,3}_[0-9]{3,3}[a-zA-Z{3,3}.xml");
if(rx.ISmatch(textbox1.text))
{
}
else
{
}
VulpesRank #55 · 29.2K reputationPosted Apr 3, 2014, 1:19 AM EDT
string regExp = @"^[a-zA-Z]{2}\d+_[a-zA-Z0-9]+\.xml$";