Skip to content

HPF PR: dev <- Azure:dev #488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 21, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,11 @@ public abstract partial class RdsCmdlet
// explicit key name for OU element
protected const string ouKeyRegexPattern = @"OU";

// 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 +
protected const string normalCharRegexPattern = @"[A-Za-z0-9 !\$%&'()\*\-\.\/\:\?@\[\]\^_`{\|}~]";

// valid escape characters for non quoted string, , \ <CR> = < > " # ; or +, or an 8 bit value encoded as a hex pair
protected const string escapedCharRegexPattern = @"\\([ ,\\\r=<>""#;+]|[0-9A-Fa-f]{2})";

// ASCII code in hex, e.g. #ff
protected const string asciiCodeRegexPattern = @"#([0-9A-Fa-f]{2})+";

// Unicode grapheme
protected const string unicodeRegexPattern = @"(?>\P{M}\p{M}*)";

// used to separate entities, , or + followed by 0 or more spaces
protected const string delimiterRegexPattern = @"[\+,]\s*";

// an entity value, consists of normal chars, escape codes and hex codes
protected const string entityRegexPattern = @"(" + normalCharRegexPattern + @"|" + escapedCharRegexPattern + @"|" + asciiCodeRegexPattern + @"|" + unicodeRegexPattern + @")+";
// an entity value, consists of characters other than , <CR> < > " # ; + =
protected const string entityRegexPattern = @"([^,<>""#;+=\r\n])+";

// a key/entity pair, e.g DC=foo-bar.com
protected const string keyEntityRegexPattern = @"(" + keyRegexPattern + @"=" + entityRegexPattern + @")";
Expand All @@ -87,21 +75,10 @@ public abstract partial class RdsCmdlet
* The entity begins with a key which must begin with a letter and contains letters, digits, or hyphens
* [A-Z][A-Z0-9\-]*=
* (
* The entity value contains any char except for the special chars , \ <CR> = < > " # ; or +
* ([A-Za-z0-9 !\$%&'()\*\-\.\/\:\?@\[\]\^_`{\|}~])
* |
* Or an escaped special char , \ <CR> = < > " # ; + or a space, or an 8 bit ASCII code in hex
* (\\([ ,\\\r=<>""#;+]|[0-9A-Fa-f]{2}))
* |
* Or a # followed by a sequence of 8 bit ASCII codes in hex
* (#([0-9A-Fa-f]{2})+)
*
* Or a Unicode grapheme
* (?>\P{M}\p{M}*)
*
* The entity value contains one or more characters except for the special chars , \ <CR> = < > " # ; or +
* [^,<>""#;\+=\r\n]
* There will be 1 or more characters matching this pattern
* )+
* )
* Followed by a delimeter, either , or +
* [\+,]\s*
* There may be 0 or more entities matching this pattern
Expand All @@ -114,14 +91,8 @@ public abstract partial class RdsCmdlet
* The entity key must match OU exactly. This guarantees the overall pattern contains at least oen OU element
* OU=
* (
* The entity value contains any char except for the special chars , \ <CR> = < > " # ; or +
* ([A-Za-z0-9 !\$%&'()\*\-\.\/\:\?@\[\]\^_`{\|}~])
* |
* Or an escaped special char , \ <CR> = < > " # ; + or a space, or an 8 bit ASCII code in hex
* (\\([ ,\\\r=<>""#;+]|[0-9A-Fa-f]{2}))
* |
* Or a # followed by a sequence of 8 bit ASCII codes in hex
* (#([0-9A-Fa-f]{2})+)
* The entity value contains one or more characters except for the special chars , \ <CR> = < > " # ; or +
* [^,<>""#;\+=\r\n]
* There will be 1 or more characters matching this pattern
* )+
* )
Expand All @@ -135,14 +106,8 @@ public abstract partial class RdsCmdlet
* The entity begins with a key which must begin with a letter and contains letters, digits, or hyphens
* [A-Z][A-Z0-9\-]*=
* (
* The entity value contains any char except for the special chars , \ <CR> = < > " # ; or +
* ([A-Za-z0-9 !\$%&'()\*\-\.\/\:\?@\[\]\^_`{\|}~])
* |
* Or an escaped special char , \ <CR> = < > " # ; + or a space, or an 8 bit ASCII code in hex
* (\\([ ,\\\r=<>""#;+]|[0-9A-Fa-f]{2}))
* |
* Or a # followed by a sequence of 8 bit ASCII codes in hex
* (#([0-9A-Fa-f]{2})+)
* The entity value contains one or more characters except for the special chars , \ <CR> = < > " # ; or +
* [^,<>""#;\+=\r\n]
* There will be 1 or more characters matching this pattern
* )+
* )
Expand Down