티스토리 뷰

프로그래밍

정규표현식 예제

warpmemory 2017. 5. 8. 17:07

소문자, 대문자, 숫자 조합 8글자 이상 패스워드 매치

1
(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{8,}$/)
cs


apache httpd virtualhost

1
(?:<VirtualHost\s+(.*)>)((?:(?!</VirtualHost>).*\n?)+)
cs


postgresql log

1
\[([^\]]*)\] (?:\[([^\]]*)\] )?(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d \w*) (?:(.*)\((\d+)\))?\[(\d*)\]: \[(.*)\] (\w*):\s+(?:duration: ([\d.]*) ms\s+statement:((?:(?!\[.*\] \d{4}-\d\d-\d\d \d\d:\d\d:\d\d \w*).*\n?)+)?)?((?:(?!\[.*\] \d{4}-\d\d-\d\d \d\d:\d\d:\d\d \w*).*\n?)*)
cs


php error log

1
\[([^\]]*)\] (?:\[([^\]]*)\] )?\[(\d\d-\w\w\w-\d\d\d\d \d\d:\d\d:\d\d)(?: [\w/]+)?\] PHP ([^:]+):\s+((?:(?!\[.*\] \[\d\d-\w\w\w-\d\d\d\d \d\d:\d\d:\d\d(?: [\w/]+)?\]).*\n?)+)
cs


iptables log

1
\[([^\]]*)\] (\w\w\w [\s\d]\d \d\d:\d\d:\d\d) (\w+) (\w+): (?::\s*)?([\w -]*):\s*(?:IN=(\w*) )?(?:OUT=(\w*) )?(?:MAC=([\w:]*) )?(?:SRC=([\w\.]*) )?(?:DST=([\w\.]*) )?(?:LEN=(\d*) )?(?:TOS=(\w*) )?(?:PREC=(\w*) )?(?:TTL=(\d*) )?(?:ID=(\d*) )?(?:(CE|DF|MF) )?(?:PROTO=(\w*) )?(?:TYPE=(\d*) )?(?:CODE=(\d*) )?(?:(\[.*\]) ?)?(?:ID=(\d*) )?(?:SEQ=(\d*) ?)?(?:SPT=(\d*) )?(?:DPT=(\d*) )?(?:LEN=(\d*) ?)?(?:WINDOW=(\d*) )?(?:RES=(\w*) )?(?:((?:CWR ?|ECE ?|URG ?|ACK ?|PSH ?|RST ?|SYN ?|FIN ?)+) )?(?:URGP=(\d*) ?)?((?:(?!\[.*\] \w\w\w [\s\d]\d \d\d:\d\d:\d\d).*)+)
cs


httpd error log

1
\[([^\]]*)\]\s+(?:\[([^\]]*)\] )?\[(\w{3} \w{3} \d\d \d\d:\d\d:\d\d \d{4})\]\s+\[([^\]]*)\]\s+(?:(?:\[client\s+([^\]]*)\])\s+)?((?:(?!\[([^\]]*)\]\s+(?:\[([^\]]*)\] )?\[(\w{3} \w{3} \d\d \d\d:\d\d:\d\d \d{4})\]).*\n?)*)
cs


nginx error log

1
\[([^\]]*)\]\s+(?:\[([^\]]*)\] )?(\d{4}/\d\d/\d\d \d\d:\d\d:\d\d)\s+\[([^\]]*)\]\s+([^:]*):\s+(\*\d+)\s+([^,]*),\s+client:\s+([^,]*),\s+server:\s([^,]*),\s+request:\s+(\"[^\"]*\"),\s+host:\s+(\"[^\"]*\")(?:,\s+referrer:\s+(\"[^\"]*\"))?
cs


xferlog

1
\[([^\]]*)\]\s+(?:\[([^\]]*)\] )?(\w{3} \w{3} [\s\d]\d \d\d:\d\d:\d\d \d{4})\s+(\d+)\s+([^\s]*)\s+(\d+)\s+([^\s]*)\s+(\w)\s+(\w)\s+(\w)\s+(\w)\s+([^\s]*)\s+([^\s]*)\s+(\d)\s+([^\s]*)\s+(\w)
cs


댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
페이지
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
글 보관함