Skip to main content
Fightergator
Inspiring
Dec 14, 2022 7:26 PM UTC
Question

RegExp Help With Look Ahead Exclude Group

I'm building some regex searches and ran into one I can't seem to solve.  I'm searching for all incorrect capitalization and punctuations of Split "S" (the aircraft maneuver).  The expression I'm using is:

[Ss]plit[ -]“?[Ss]”?(?<!Split “S")

The goal is to find all combinations of initial caps and punctuation (space, hyphen, quoteddbl) and using a look ahead to exclude the correct term.  It works great at finding all the variations, but also finds [Split "S]"...ignoring the right double quote punctuation.  I'm having no luck, so thought I'd turn to the experts.

    This topic is closed to new replies. Start a new post to keep the conversation going.

    1 reply

    Participating Frequently
    Jul 21, 2023 1:17 AM UTC

    Hi,Fightergator
    I don't know your environment, so I wrote a regular expression that works with VS Code searches.
    Try the following regex:

    (?<![a-zA-Z])(?!Split "S")[sS]plit[ -]"?[sS]"?(?![a-zA-Z])

    Translate