forked from bcdady/MyScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregex.txt
28 lines (18 loc) · 1.08 KB
/
regex.txt
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
# See also https://regex101.com/library
# IP Address:
((25[0-5])|(2[0-4][0-9])|(1[0-9][0-9])|([1-9][0-9])|([0-9]))\.((25[0-5])|(2[0-4][0-9])|(1[0-9][0-9])|([1-9][0-9])|([0-9]))\.((25[0-5])|(2[0-4][0-9])|(1[0-9][0-9])|([1-9][0-9])|([0-9]))\.((25[0-5])|(2[0-4][0-9])|(1[0-9][0-9])|([1-9][0-9])|([0-9]))
# Private IP Address:
# IP Address:
(10|192)\.((25[0-5])|(2[0-4][0-9])|(1[0-9][0-9])|([1-9][0-9])|([0-9]))\.((25[0-5])|(2[0-4][0-9])|(1[0-9][0-9])|([1-9][0-9])|([0-9]))\.((25[0-5])|(2[0-4][0-9])|(1[0-9][0-9])|([1-9][0-9])|([0-9]))
# Find / replace line-breaks and white spaces before a {
(\S)([\s\n]{2,}){
# Find / replace line-breaks from between Function {
[F|f]unction\s+(\S+)[\s\n]+{ // Function $1 {
# Find / replace line-breaks between Function { , OR , ) {
([F|f]unction)[\s\n]{2,}(\S+)[\s\n]+|\))[\s\n]{2,}{ // $1 {
# Find / replace line-breaks from between } else {
}[\s\n]{2,}else[\s\n]+{ // } else {
# Find / replace single backslash with doubles (e.g. for json)
([^\\])\\([^\\]) // $1\\\\$2
# Find / replace line-breaks from between } elseif
}[\s\n]+(else|elseif)[\s\n]+{ // } $1 {