1

I'm just getting started with Regex and want to select text that has ONLY one tab in front between two specific strings.

In that case I want to select text that is between ABC and CDE (don't select ABC and CDE) and has ONLY one tab in front of it. So I want to select Rotterdam, Amsterdam, China and Japan and do not select e.g. Hello and I have two tabs in front of me because they have two tabs.

EFGADADA
        Hello
EFGHI
        Oslo
        Australia
EFGHI
ABC
    Rotterdam
    Amsterdam
    China
    Japan
        Hello
        I have two tabs in front of me
CDE
        Oslo
        Australia

I already have this which deselects everything that has two tabs in front of it:

(?<!\t\t(.?)+)[ a-zA-ZäöüÄÖÜßé@.()&-/"“]+

I know, this selects also ABC, CDE and EFGHI, which of course, don't have any tabs in front of them but thats fine because between ABC and CDE is only Text that has tabs in front of it.

Btw. I use the Regex inside Power Automate Desktop, if that matters.

Skin
  • 9,085
  • 2
  • 13
  • 29
SevenTwo
  • 35
  • 5
  • 1
    What tool or language are you using? You might get all matches in a capture group like this `^\S+((?:\n\t\S+)+)` https://regex101.com/r/6ov6kf/1 – The fourth bird Dec 02 '22 at 17:47
  • @Thefourthbird Sorry, I forgot to say that. I'm using Regex inside Microsofts Power Automate Desktop to get specifc text values, if you know that. Your code seems to work in your example but I don't think it will work for my use case. I will edit the example a bit more. Thanks anyway for your interest and help! – SevenTwo Dec 02 '22 at 18:10

0 Answers0