javascript - Regex validation for Unix File -
i trying validate unix file path below.
/tester/test/testaa.html /testing/test.jsp /test/abc.html /test/testxyz.htm
it should result file name starts "test" , shud not check folder name. result should below.
/tester/test/testaa.html /testing/test.jsp /test/testxyz.htm
could please on this.
you can using javascript first read file path string then read first 5 char of string if start test/ skip file dont validate if otherwise validate other files.
<script> function myfunction() { var path = "/tester/test/testaa.html"; var folderpath = path.substring(1, 6); if(folderpath == "test/") { alert("skip file"); } else { alert("validate file"); } } </script>
Comments
Post a Comment