Bug details

GREP: Repetition (*, +) at the end of a Positive Lookbehind group doesn't seem to work

Product: Adobe InDesign CC 2019 (14.01)

Steps to reproduce:
- Create a document with the text "abcde"
- (Case 1) Do a GREP search for "(?<=bc+)d"
- (Case 1) Do a GREP search for "(?<=bc*)d"

Expected result: highlight the "d"

Actual result: Cannot find match.

Note that searching for "(?<=bc)d" does work, as do of course "(?<b)c*d" and "(?=b)c+d".

Note also that this applied to GREP Styles in a paragraph style.

2 votes
Sign in
(thinking…)
Password icon
Signed in as (Sign out)

We’ll send you updates on this idea

Erez Volk shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

3 comments

Sign in
(thinking…)
Password icon
Signed in as (Sign out)
Submitting...
  • Jean-Claude Tremblay commented  ·   ·  Flag as inappropriate

    Quantifiers like ? + * are not allowed in Lookbehind. That’s a limitation in Regex.

    In Indesign you can use the \K to go around this.

    So this will works.

    bc+\Kd
    bc*\Kd

  • AndyWizz commented  ·   ·  Flag as inappropriate

    test 534.878-x
    (\s)(?=\d+\.\d+)
    works

    (?<=\d+)-\w
    works not

    (?<=\d)-\w
    works

  • Anonymous commented  ·   ·  Flag as inappropriate

    I believe multipliers are not allowed in the look ahead/behind syntax as they can make the confirmation match much to broad.

    In a search and replace scenario, I use sets to identify the targets so (?<=bc*)d would work like (?<=b)(c*)(d) if you identify your change onto $2 [assuming that c*($1) was not intended to change]

    $1newcontent

    This wouldn't work with a style change.

Feedback and Knowledge Base