Skip to main content
Participant
February 19, 2019
Answered

grep, find two words before right indent tab

  • February 19, 2019
  • 1 reply
  • 688 views

Trying to figure out quite simple thing with grep, but seems like it is not my thing... can someone help?

Need to find two words before right indent tab

For example:

This is the text there is <right indent tab>

want to find:

This is the text there is <right indent tab>

Words that need to be found might be lower or upper case.

Thanks

    This topic has been closed for replies.
    Correct answer vinny38

    Hi

    Give this regex a try:

    [-\w]+\h[-\w]+(?=~y)

    FYI [-\w] is a custom character class that catches any word characters (any digit, any letter - upper or lowercase- and underscore character) AND hyphens (that should be by default imho)...

    1 reply

    vinny38
    vinny38Correct answer
    Legend
    February 19, 2019

    Hi

    Give this regex a try:

    [-\w]+\h[-\w]+(?=~y)

    FYI [-\w] is a custom character class that catches any word characters (any digit, any letter - upper or lowercase- and underscore character) AND hyphens (that should be by default imho)...

    TheroDAuthor
    Participant
    February 19, 2019

    Thanks! This works.