I have a very big file with text and want to find:
- all occurrences of string
selectedRow
which are not: - part of
selectedRowIds
- are proceeded by
props.
I am interested in line numbers where all of these conditions are met.
Is is possible to achieve with RegExp?
So e.g. for test data:
this.state.selectedRow
this.props.selectedRow
selectedRowIds
it will match only first line.
CodePudding user response:
You can use look around to exclude matches with particular prefix/postfixes:
(?<!props\.)selectedRow(?!Ids)?