You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@ -0,0 +1,51 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <copyright file="DelayedRegex.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.Web.Configuration {
|
||||
|
||||
using System.Collections;
|
||||
using System.Configuration;
|
||||
using System.IO;
|
||||
using System.Security;
|
||||
using System.Security.Permissions;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web.Configuration;
|
||||
using System.Web.Util;
|
||||
using System.Xml;
|
||||
|
||||
using Pair = System.Web.UI.Pair;
|
||||
|
||||
internal class DelayedRegex {
|
||||
|
||||
private String _regstring;
|
||||
private Regex _regex;
|
||||
|
||||
internal DelayedRegex(String s) {
|
||||
_regex = null;
|
||||
_regstring = s;
|
||||
}
|
||||
|
||||
internal Match Match(String s) {
|
||||
EnsureRegex();
|
||||
return _regex.Match(s);
|
||||
}
|
||||
|
||||
internal int GroupNumberFromName(String name) {
|
||||
EnsureRegex();
|
||||
return _regex.GroupNumberFromName(name);
|
||||
}
|
||||
|
||||
internal void EnsureRegex() {
|
||||
string regstring = _regstring;
|
||||
if(_regex == null) {
|
||||
_regex = new Regex(regstring);
|
||||
//free original
|
||||
_regstring = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user