$content = qq(?XML version="1.0'); if ($content =~/\?XML\s+version=[\'\"]1.0[\'\"](\s+encoding=[\'\"][^\' + +\"]*[\'\"])?/){ print"Input file is valid"; }else{ print"File is invalid"; } __END__ Input file is valid
Maybe you want to look at perlop for string equality, or maybe you want to use a real XML parser?
In reply to Re: Regular expression to check XML type
by Corion
in thread Regular expression to check XML type
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |