• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# RubyRegexOptions类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: CreateRegexUM

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


示例17: RegexpTransformer

 private RegexpTransformer(string/*!*/ rubyPattern, RubyRegexOptions options) {
     _rubyPattern = rubyPattern;
     _options = options;
 }
开发者ID:eblumenfeld,项目名称:main,代码行数:4,代码来源:RegexpTransformer.cs


示例18: TestCorrectPatternTranslation

 //[DebuggerHidden]
 private void TestCorrectPatternTranslation(string/*!*/ pattern, RubyRegexOptions options, string/*!*/ expected, bool expectedGAnchor, IList<string> expectedWarnings)
 {
     bool hasGAnchor;
     List<string> warnings;
     string actual = RegexpTransformer.Transform(pattern, options, out hasGAnchor, out warnings);
     AreEqual(expected, actual);
     new Regex(expected);
     Assert(hasGAnchor == expectedGAnchor);
     if (warnings != null) {
         Assert(expectedWarnings != null);
         Assert(expectedWarnings.Count == warnings.Count);
         foreach (var warning in expectedWarnings) {
             Assert(warnings.IndexOf(warning) >= 0);
         }
     } else {
         Assert(expectedWarnings == null || expectedWarnings.Count == 0);
     }
 }
开发者ID:TerabyteX,项目名称:main,代码行数:19,代码来源:RegexTests.cs


示例19: GetKCoding

        public static RubyEncoding GetKCoding(RubyRegexOptions options) {
#if SILVERLIGHT
            return null;
#else
            switch (options & RubyRegexOptions.EncodingMask) {
                case RubyRegexOptions.EUC: return RubyEncoding.KCodeEUC;
                case RubyRegexOptions.SJIS: return RubyEncoding.KCodeSJIS;
                case RubyRegexOptions.UTF8: return RubyEncoding.KCodeUTF8;
                default: return null;
            }
#endif
        }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:12,代码来源:RubyEncoding.cs


示例20: ToRegularExpression

 public abstract GenericRegex/*!*/ ToRegularExpression(RubyRegexOptions options);
开发者ID:bclubb,项目名称:ironruby,代码行数:1,代码来源:MutableString.Content.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Rule类代码示例发布时间:2022-05-24
下一篇:
C# RubyRegex类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap