正则表达式-从字符串中提取子字符串

时间:2019-03-18 14:13:36

标签: regex google-data-studio

在此提取Google Data Studio(RE2)的过程中会提供一些帮助:

我需要从此字符串中提取“ 1.”和“ https://www.journorequests.com”之间的所有内容

"- Health & Fitness ---
**1.** Phee Waterfield (https://www.twitter.com/pheecetious) 
Does anyone know of any mental health accelerators or incubators? #journorequest #techjpr #prrequest
https://www.journorequests.com/redirect… & Fitness&url=https%3A%2F%2Fwww.twitter.com%2Fpheecetious%2Fstatus%2F920331054342463488&medium=instant_alert"

1 个答案:

答案 0 :(得分:0)

我认为您正在寻找的是

  users: [
    {
      name: 'foo',
      forwhom: 0,
      signatures: {
        clientSignature: {
          value: ''
        }
      }
    },
    {
      name: 'bar',
      forwhom: 1,
      signatures: {
        clientSignature: {
          value: ''
        }
      }
    }
  ]

这将返回您在第一个捕获组中所需的内容。

See my work here.

此外,您可能还想阅读 Regular Expressions, Capturing groups