@@ -48,23 +48,11 @@ public abstract partial class RdsCmdlet
48
48
// explicit key name for OU element
49
49
protected const string ouKeyRegexPattern = @"OU" ;
50
50
51
- // all normal non quoted string chars, which includes all ASCII values in the range 0x20-0x126 except for escaped character for non quoted string, , \ <CR> = < > " # ; or +
52
- protected const string normalCharRegexPattern = @"[A-Za-z0-9 !\$%&'()\*\-\.\/\:\?@\[\]\^_`{\|}~]" ;
53
-
54
- // valid escape characters for non quoted string, , \ <CR> = < > " # ; or +, or an 8 bit value encoded as a hex pair
55
- protected const string escapedCharRegexPattern = @"\\([ ,\\\r=<>""#;+]|[0-9A-Fa-f]{2})" ;
56
-
57
- // ASCII code in hex, e.g. #ff
58
- protected const string asciiCodeRegexPattern = @"#([0-9A-Fa-f]{2})+" ;
59
-
60
- // Unicode grapheme
61
- protected const string unicodeRegexPattern = @"(?>\P{M}\p{M}*)" ;
62
-
63
51
// used to separate entities, , or + followed by 0 or more spaces
64
52
protected const string delimiterRegexPattern = @"[\+,]\s*" ;
65
53
66
- // an entity value, consists of normal chars, escape codes and hex codes
67
- protected const string entityRegexPattern = @"(" + normalCharRegexPattern + @"|" + escapedCharRegexPattern + @"|" + asciiCodeRegexPattern + @"|" + unicodeRegexPattern + @" )+";
54
+ // an entity value, consists of characters other than , <CR> < > " # ; + =
55
+ protected const string entityRegexPattern = @"([^,<>""#;+=\r\n] )+" ;
68
56
69
57
// a key/entity pair, e.g DC=foo-bar.com
70
58
protected const string keyEntityRegexPattern = @"(" + keyRegexPattern + @"=" + entityRegexPattern + @")" ;
@@ -87,21 +75,10 @@ public abstract partial class RdsCmdlet
87
75
* The entity begins with a key which must begin with a letter and contains letters, digits, or hyphens
88
76
* [A-Z][A-Z0-9\-]*=
89
77
* (
90
- * The entity value contains any char except for the special chars , \ <CR> = < > " # ; or +
91
- * ([A-Za-z0-9 !\$%&'()\*\-\.\/\:\?@\[\]\^_`{\|}~])
92
- * |
93
- * Or an escaped special char , \ <CR> = < > " # ; + or a space, or an 8 bit ASCII code in hex
94
- * (\\([ ,\\\r=<>""#;+]|[0-9A-Fa-f]{2}))
95
- * |
96
- * Or a # followed by a sequence of 8 bit ASCII codes in hex
97
- * (#([0-9A-Fa-f]{2})+)
98
- *
99
- * Or a Unicode grapheme
100
- * (?>\P{M}\p{M}*)
101
- *
78
+ * The entity value contains one or more characters except for the special chars , \ <CR> = < > " # ; or +
79
+ * [^,<>""#;\+=\r\n]
102
80
* There will be 1 or more characters matching this pattern
103
81
* )+
104
- * )
105
82
* Followed by a delimeter, either , or +
106
83
* [\+,]\s*
107
84
* There may be 0 or more entities matching this pattern
@@ -114,14 +91,8 @@ public abstract partial class RdsCmdlet
114
91
* The entity key must match OU exactly. This guarantees the overall pattern contains at least oen OU element
115
92
* OU=
116
93
* (
117
- * The entity value contains any char except for the special chars , \ <CR> = < > " # ; or +
118
- * ([A-Za-z0-9 !\$%&'()\*\-\.\/\:\?@\[\]\^_`{\|}~])
119
- * |
120
- * Or an escaped special char , \ <CR> = < > " # ; + or a space, or an 8 bit ASCII code in hex
121
- * (\\([ ,\\\r=<>""#;+]|[0-9A-Fa-f]{2}))
122
- * |
123
- * Or a # followed by a sequence of 8 bit ASCII codes in hex
124
- * (#([0-9A-Fa-f]{2})+)
94
+ * The entity value contains one or more characters except for the special chars , \ <CR> = < > " # ; or +
95
+ * [^,<>""#;\+=\r\n]
125
96
* There will be 1 or more characters matching this pattern
126
97
* )+
127
98
* )
@@ -135,14 +106,8 @@ public abstract partial class RdsCmdlet
135
106
* The entity begins with a key which must begin with a letter and contains letters, digits, or hyphens
136
107
* [A-Z][A-Z0-9\-]*=
137
108
* (
138
- * The entity value contains any char except for the special chars , \ <CR> = < > " # ; or +
139
- * ([A-Za-z0-9 !\$%&'()\*\-\.\/\:\?@\[\]\^_`{\|}~])
140
- * |
141
- * Or an escaped special char , \ <CR> = < > " # ; + or a space, or an 8 bit ASCII code in hex
142
- * (\\([ ,\\\r=<>""#;+]|[0-9A-Fa-f]{2}))
143
- * |
144
- * Or a # followed by a sequence of 8 bit ASCII codes in hex
145
- * (#([0-9A-Fa-f]{2})+)
109
+ * The entity value contains one or more characters except for the special chars , \ <CR> = < > " # ; or +
110
+ * [^,<>""#;\+=\r\n]
146
111
* There will be 1 or more characters matching this pattern
147
112
* )+
148
113
* )
0 commit comments