首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Integromat的Regex

Integromat的Regex
EN

Stack Overflow用户
提问于 2022-04-11 22:08:00
回答 1查看 710关注 0票数 1

我得到了一个“无限循环”,下面的regex表达式位于解析器Integromat中。

(?<=\n)(.*)(?=\nA|B)

我知道这是由于\\,但是不确定Integromat中的其他选项。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-04-12 21:17:42

尝试这样的模式

代码语言:javascript
复制
(?m)^(.+?)(?:\r?\nA|B)

解释

代码语言:javascript
复制
m modifier: multi line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string)
^ asserts position at start of a line
1st Capturing Group (.+?)
  . matches any character (except for line terminators)
  +? matches the previous token between one and unlimited times, as few times as possible, expanding as needed (lazy)
Non-capturing group (?:\r?\nA|B)
  1st Alternative \r?\nA
  \r matches a carriage return (ASCII 13)
  ? matches the previous token between zero and one times, as many times as 
possible, giving back as needed (greedy)
  \n matches a line-feed (newline) character (ASCII 10)
A matches the character A with index 6510 (4116 or 1018) literally (case sensitive)
2nd Alternative B
  B matches the character B with index 6610 (4216 or 1028) literally (case sensitive)
票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71834830

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档