我目前正在尝试编写一个正则表达式,它将仅提取分配给 state:
标记的值,而不考虑除标题之外的其他参数的顺序。
例如:
addcard "My card title" assigned: @username @username2 state: ready to
deploy due: Next Wednesday project: tooling #tag1 #tag2 #tag3
addcard "My card title" state:ready to deploy assigned: @username
@username2 due: Next Wednesday project: tooling #tag1 #tag2 #tag3
addcard "My card title" #tag1 #tag2 #tag3 state: ready to deploy
assigned: @username @username2 due: Next Wednesday project: tooling
应该全部返回:ready to deploy
or state:ready to deploy
or state: ready to deploy
我尝试过使用负查找,但我开始觉得我可能对负查找理解不够透彻。
我当前的正则表达式:regex101
最佳答案
关于regex - 用于匹配以部分已知终止符结尾的未知长度字符串的正则表达式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41455733/