当前位置: 首页>>代码示例>>C#>>正文


C# RubyRegexOptions类代码示例

本文整理汇总了C#中RubyRegexOptions的典型用法代码示例。如果您正苦于以下问题:C# RubyRegexOptions类的具体用法?C# RubyRegexOptions怎么用?C# RubyRegexOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RubyRegexOptions类属于命名空间,在下文中一共展示了RubyRegexOptions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RegularExpression

        public RegularExpression(List<Expression>/*!*/ pattern, RubyRegexOptions options, bool isCondition, SourceSpan location)
            : base(location) {
            Assert.NotNull(pattern);

            _pattern = pattern;
            _options = options;
        }
开发者ID:BrianGenisio,项目名称:ironruby,代码行数:7,代码来源:RegularExpression.cs

示例2: Transform

 internal static string Transform(string/*!*/ rubyPattern, RubyRegexOptions options) {
     if (rubyPattern == "\\Af(?=[[:xdigit:]]{2}+\\z)") {
         // pp.rb uses this pattern. The real fix requires cracking the entire regexp and so is left for later
         return "\\Af(?=(?:[[:xdigit:]]{2})+\\z)";
     }
     RegexpTransformer transformer = new RegexpTransformer(rubyPattern);
     return transformer.Transform();
 }
开发者ID:jcteague,项目名称:ironruby,代码行数:8,代码来源:RegexpTransformer.cs

示例3: Transform

 internal static string Transform(string/*!*/ rubyPattern, RubyRegexOptions options, out bool hasGAnchor) {
     if (rubyPattern == "\\Af(?=[[:xdigit:]]{2}+\\z)") {
         // pp.rb uses this pattern. The real fix requires cracking the entire regexp and so is left for later
         hasGAnchor = false;
         return "\\Af(?=(?:[[:xdigit:]]{2})+\\z)";
     }
     RegexpTransformer transformer = new RegexpTransformer(rubyPattern);
     var result = transformer.Transform();
     hasGAnchor = transformer._hasGAnchor;
     return result;
 }
开发者ID:ExpertsInside,项目名称:IronSP,代码行数:11,代码来源:RegexpTransformer.cs

示例4: Transform

 internal static string Transform(string/*!*/ rubyPattern, RubyRegexOptions options, out bool hasGAnchor) {
     // TODO: surrogates (REXML uses this pattern)
     if (rubyPattern == "^[\t\n\r -\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF]*$") {
         hasGAnchor = false;
         return "^(?:[\t\n\r -\uD7FF\uE000-\uFFFD]|[\uD800-\uDBFF][\uDC00-\uDFFF])*$";
     }
     
     RegexpTransformer transformer = new RegexpTransformer(rubyPattern);
     var result = transformer.Transform();
     hasGAnchor = transformer._hasGAnchor;
     return result;
 }
开发者ID:jschementi,项目名称:iron,代码行数:12,代码来源:RegexpTransformer.cs

示例5: CreateRegexWorker

        private static RubyRegex/*!*/ CreateRegexWorker(
            RubyRegexOptions options, 
            StrongBox<RubyRegex> regexpCache, 
            bool isLiteralWithoutSubstitutions,
            Func<RubyRegex> createRegex) {

            try {
                bool once = ((options & RubyRegexOptions.Once) == RubyRegexOptions.Once) || isLiteralWithoutSubstitutions;
                if (once) {
                    // Note that the user is responsible for thread synchronization
                    if (regexpCache.Value == null) {
                        regexpCache.Value = createRegex();
                    }
                    return regexpCache.Value;
                } else {
                    // In the future, we can consider caching the last Regexp. For some regexp literals 
                    // with substitution, the substition will be the same most of the time
                    return createRegex();
                }
            } catch (RegexpError e) {
                if (isLiteralWithoutSubstitutions) {
                    // Ideally, this should be thrown during parsing of the source, even if the 
                    // expression happens to be unreachable at runtime.
                    throw new SyntaxError(e.Message);
                } else {
                    throw;
                }
            }
        }
开发者ID:teejayvanslyke,项目名称:ironruby,代码行数:29,代码来源:RubyOps.cs

示例6: CreateRegexN

 public static RubyRegex/*!*/ CreateRegexN(object[]/*!*/ strings, RubyEncoding/*!*/ encoding, RubyRegexOptions options, StrongBox<RubyRegex> regexpCache) {
     Func<RubyRegex> createRegex = delegate { return new RubyRegex(CreateMutableStringN(strings, encoding), options); };
     return CreateRegexWorker(options, regexpCache, false, createRegex);
 }
开发者ID:teejayvanslyke,项目名称:ironruby,代码行数:4,代码来源:RubyOps.cs

示例7: TransformPattern

 internal static string/*!*/ TransformPattern(string/*!*/ pattern, RubyRegexOptions options) {
     return RegexpTransformer.Transform(pattern, options);
 }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:3,代码来源:GenericRegex.cs

示例8: GenericRegex

 protected GenericRegex(RubyRegexOptions options) {
     ContractUtils.Requires(RubyRegex.GetPersistedOptions(options) == options);
     _options = options;
 }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:4,代码来源:GenericRegex.cs

示例9: ToRegularExpression

 public override GenericRegex/*!*/ ToRegularExpression(RubyRegexOptions options) {
     // TODO: Fix BinaryRegex and use instead
     return new StringRegex(ToString(), options);
 }
开发者ID:bclubb,项目名称:ironruby,代码行数:4,代码来源:MutableString.BinaryContent.cs

示例10: CreateRegexM

 public static RubyRegex/*!*/ CreateRegexM(MutableString str1, RubyRegexOptions options) {
     return new RubyRegex(MutableString.CreateInternal(str1), options);
 }
开发者ID:joshholmes,项目名称:ironruby,代码行数:3,代码来源:RubyOps.cs

示例11: SetRegexOptions

 internal void SetRegexOptions(RubyRegexOptions value) {
     Integer1 = (int)value;
 }
开发者ID:tnachen,项目名称:ironruby,代码行数:3,代码来源:TokenValue.cs

示例12: CreateRegexU

 public static RubyRegex/*!*/ CreateRegexU(string/*!*/ str1, RubyRegexOptions options) {
     return new RubyRegex(str1, options);
 }
开发者ID:joshholmes,项目名称:ironruby,代码行数:3,代码来源:RubyOps.cs

示例13: CreateRegexE

 public static RubyRegex/*!*/ CreateRegexE(string/*!*/ str1, int codepage, RubyRegexOptions options) {
     return new RubyRegex(str1, options);
 }
开发者ID:joshholmes,项目名称:ironruby,代码行数:3,代码来源:RubyOps.cs

示例14: CreateRegexN

 public static RubyRegex/*!*/ CreateRegexN(object[]/*!*/ strings, int codepage, RubyRegexOptions options) {
     return new RubyRegex(ConcatenateStrings(strings), options);
 }
开发者ID:joshholmes,项目名称:ironruby,代码行数:3,代码来源:RubyOps.cs

示例15: CreateRegexME

 public static RubyRegex/*!*/ CreateRegexME(MutableString str1, string/*!*/ str2, int codepage, RubyRegexOptions options) {
     return new RubyRegex(MutableString.CreateInternal(str1).Append(str2), options);
 }
开发者ID:joshholmes,项目名称:ironruby,代码行数:3,代码来源:RubyOps.cs


注:本文中的RubyRegexOptions类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。