Regex : remaniées et plus simple à utiliser

This commit is contained in:
Maximilien LEDOUX
2022-03-15 10:54:31 +01:00
parent 52ee6194b9
commit 6f04606c69
2 changed files with 43 additions and 17 deletions

View File

@@ -1,22 +1,23 @@
//Standardized definitions
digit = [0-9]
port = (6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9]{4})|([0-5]{0,5})|([0-9]{1,4})
size = [0-9]{1,10}
line = \r\n
visiblechar = \p{Print}
passchar = [^ !]
binary = .
password = [^ !]{5,50}
bl = //espace
letter = [A-Za-z]
digit_letter = [A-Za-z0-9]
filename = [^ !]{1,20}
domain = [A-Za-z0-9.]{5,20}
hash_filename = [A-Za-z0-9.]{50,200}
hash_filecontent = [A-Za-z0-9.]{50,200}
file_info = [A-Za-z0-9.]{50,200} [0-9]{1,10} [A-Za-z0-9.]{50,200}
login = [A-Za-z0-9]{2,20}
digit = [\x30-\x39] //Unicode
port = (6553[\x30-\x35])|(655[\x30-\x32][\x30-\x39])|(65[\x30-\x34][\x30-\x32]{2})|(6[\x30-\x34][\x30-\x39]{3})|([\x31-\x35][\x30-\x39]{4})|([\x30-\x35]{0,5})|([\x30-\x39]{1,4})
size = [\x30-\x39]{1,10}
line = \x0D\x0A
visiblechar = [\x20-\xFF]
passchar = [\x22-\xFF]
binary = [\x00-\xFF]
password = [\x22-\xFF]{5,50}
bl = \x20 //espace
letter = [\x41-\x5A\x61-\x7A]
digit_letter = [\x30-\x39]|[\x41-\x5A\x61-\x7A]
filename = [\x22-\xFF]{1,20}
domain = [\x30-\x39\x41-\x5A\x61-\x7A]{5,20}[.] //Le point est obligatoire
hash_filename = [\x30-\x39\x41-\x5A\x61-\x7A]{50,200}
hash_filecontent = [\x30-\x39\x41-\x5A\x61-\x7A]{50,200}
file_info = [\x30-\x39\x41-\x5A\x61-\x7A]{50,200}\x20[\x30-\x39]{1,10}\x20[\x30-\x39\x41-\x5A\x61-\x7A]{50,200}
login = [\x30-\x39\x41-\x5A\x61-\x7A]{5,20}
//OBSOLETE
//StorBackEnd to FileFrontEnd
sbe_hello = ^HELLO ([A-Za-z0-9.]{5,20}) ([\d]{0,5})\r\n$ //TODO \r\n -> à tester pour voir si déjà dans le flux ou doit être construit