Skip to content

Commit ca699ac

Browse files
Updates to ParseLinksUtility
Adds support for hyphinated host names in ParseLinksUtility Exposes ParseLinksUtility as public Original feature request/bug report can be found here: #2
1 parent 98e5f77 commit ca699ac

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

SendsafelyAPI/Utilities/ParseLinksUtility.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,17 @@
55

66
namespace SendSafely.Utilities
77
{
8-
class ParseLinksUtility
8+
/// <summary>
9+
/// Utility for extracting a list of valid SendSafely package links from text input.
10+
/// </summary>
11+
public class ParseLinksUtility
912
{
10-
private String REGEX = "(https:\\/\\/[a-zA-Z\\.]+\\/receive\\/\\?[A-Za-z0-9&=\\-]+packageCode=[A-Za-z0-9\\-_]+#keyCode=[A-Za-z0-9\\-_]+)";
13+
private String REGEX = "(https:\\/\\/[a-zA-Z\\.-]+\\/receive\\/\\?[A-Za-z0-9&=\\-]+packageCode=[A-Za-z0-9\\-_]+#keyCode=[A-Za-z0-9\\-_]+)";
1114

15+
/// <summary>
16+
/// Extract a list of valid SendSafely package links from text.
17+
/// </summary>
18+
/// <param name="text"> The text input that you want to check for package links.</param>
1219
public List<String> Parse(String text)
1320
{
1421
List<String> links = new List<String>();
@@ -21,10 +28,10 @@ public List<String> Parse(String text)
2128
{
2229
links.Add(match.Value);
2330
}
24-
31+
2532
}
2633

27-
return links;
34+
return links;
2835
}
2936
}
30-
}
37+
}

0 commit comments

Comments
 (0)