mardi 20 octobre 2020

Java 11: Filename regex match return false

I have a regex for a filename that is returning false in my tests, though works fine on online regex testers: '''Pattern p = Pattern.compile("[a-zA-Z0-9]{1,200}[\.[a-zA-Z0-9]{1,10}]?"); p.matcher("filename.txt").matches();''' => returns false

Aucun commentaire:

Enregistrer un commentaire