【问题标题】:probleming in generating corresponding string for a regex [closed]为正则表达式生成相应字符串时出现问题[关闭]
【发布时间】:2015-04-09 05:55:54
【问题描述】:

我有一个带有正则表达式的程序:

"\\s*(\\d{1,5})?\\s*(?:<(?<pri>\\d{1,3})>)"

我需要测试匹配模式,因此我正在尝试匹配表达式的相应字符串。

你能提供一个匹配上述正则表达式的字符串示例吗?

【问题讨论】:

    标签: regex glibc


    【解决方案1】:
    23123<123>
     123  <1>
    123  <123>
     123<12>
    <123>
        <1>
    

    类似的东西。见演示。

    https://regex101.com/r/sJ9gM7/75

    <space>(0 or more)<integer>(1 to 5 may or may not be there)<space>(0 or more)<(Symbol <)<integer>(1 to 3)>(symbol >)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-04
      • 2011-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多