Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Is there any better and easy method to match this.I have written the regular expression like this, if ($content =~/\?XML\s+version=[\'\"]1.0[\'\"](\s+encoding=[\'\"][^\' +\"]*[\'\"])?/){ print"Input file is valid"; }else{ print"File is invalid"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regular expression to check XML type
by ikegami (Patriarch) on Jun 27, 2009 at 17:42 UTC | |
|
Re: Regular expression to check XML type
by Your Mother (Archbishop) on Jun 27, 2009 at 17:45 UTC | |
|
Re: Regular expression to check XML type
by Corion (Patriarch) on Jun 27, 2009 at 17:22 UTC | |
|
Re: Regular expression to check XML type
by Bloodnok (Vicar) on Jun 27, 2009 at 17:25 UTC |