【问题标题】:How to remove last sentence in text with imacros eval using regex如何使用正则表达式使用 imacros eval 删除文本中的最后一句
【发布时间】:2018-07-13 12:34:12
【问题描述】:

我尝试使用带有正则表达式的 JavaScript 替换方法删除提取文本中的最后一句。我检查正则表达式 - 它是正确的。但是 imacros 默认在代码行上,这适用于大多数情况。

SET !VAR1 EVAL("var s=\'{{!EXTRACT}}\'; s.replace(/\.[^\.]+\.?$/,'.');")

【问题讨论】:

    标签: javascript regex eval imacros


    【解决方案1】:

    尝试使用这个

    SET !VAR1 EVAL("var s=\'{{!EXTRACT}}\'; s.replace(/.[^.]+.?$/,'.');")

    我使用了网页

    https://regex101.com/

    找到问题。

    最好的问候 帕特里克

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多