Skip to content

Instantly share code, notes, and snippets.

@sauloefo
Last active December 6, 2022 11:22
Show Gist options
  • Save sauloefo/79b0b12189f37f977f0cfa43cbaab9f4 to your computer and use it in GitHub Desktop.
Save sauloefo/79b0b12189f37f977f0cfa43cbaab9f4 to your computer and use it in GitHub Desktop.
REGEX to remove references from xml files based on the outter xml node and a value to match
```
\n\s*<flowAccesses>\n([\S ]*\n){1}[\S ]*Play_Changed<[\S ]*\n([\S ]*\n){0}[\S ]*</flowAccesses>
```
{1} : number of lines *between* the outter open element and the line with the text to match;
< at the end of `Play_Changed<` : terminator to avoid matching text that starts with Play_Changed;
{0} : number of lines *between* the line with the text to match and the outter close element;
@sauloefo
Copy link
Author

sauloefo commented Dec 6, 2022

classAccesses:

\n\s*<classAccesses>\n([\S ]*\n){0}[\S ]*CreateIncidentCommand<[\S ]*\n([\S ]*\n){1}[\S ]*</classAccesses>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment