Find/Replace grep help

Engaged ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied

I'm trying to find  something that matches a lookbehind of spaces or opening brackets but can't make it work. I want to be able to find a b c when preceeded by a space or opening bracket, but not capturing the space or bracket.

 

I want it to be the following but it seems classes don't work in positive lookbehind:

(?<=[ \(])[acb]

Looks simple enough but much googling is yielding nothing, I'm probably seartching for the wrong terms.

TOPICS
How to

Views

40

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , Jun 30, 2022 Jun 30, 2022

Hi @MrZZY 

 

Try:

 

(?<=\s|\[)abc

 

~Barb

 

grep2.gif

Likes

Translate

Translate
Adobe Community Professional ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied

Hi @MrZZY 

 

Try:

 

(?<=\s|\[)abc

 

~Barb

 

grep2.gif

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied

Thanks so much! I meant opening parentheses (I don't know if it's the same where you are but in the UK brackets is often used to mean parenthese) but your answer contained the solution in terms of using the pipe character. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied

LATEST

Hi @MrZZY:

 

The pipe character means "or" so for example, look for a leading space before "abc" or look for the open bracket/parenthesis before "abc". 

 

And in the US, these are parentheses ( ) and these are brackets [ ], so we both learned something. 😊

 

~Barb

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines