Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: How do i do an exact match with Regular Expression.


Message #1 by "Ramkumar" <ramkumars@k...> on Sat, 28 Dec 2002 17:05:41 +0530
try something like :

/^((htm(l)?)|(gif)|(jp(e)?g)|(swf)|(pdf))$/i

not tested but looks okay.

At 17:05 28/12/02 +0530, you wrote:
>Hi All,
>         I have a pattern like this.
>
>                         "html","htm","gif","jpeg","jpg","swf","pdf".
>
>I am getting the file name throug <input type="file"> and validating with
>the  pattern above. it is not searching for exact match.
>if i append "s" to the html file name,the match results returns true("i.e.,
>htmls").
>
>how do i achieve exact match in regular expression?.
>
>
>Any Idea on this would be greatly appreciated.
>
>
>Thanks in advance.
>
>
>
>Thanks and Regards,
>S.Ramkumar
>
>




  Return to Index