I trying to get all data inside ' using this
['].*?[']
and additionaly i want to exclude lines which is contain System.Debug
i tried
^((?!System.debug).)*$['].*?[']
but this is not working , what i doing wrong ?
I trying to get all data inside ' using this
['].*?[']
and additionaly i want to exclude lines which is contain System.Debug
i tried
^((?!System.debug).)*$['].*?[']
but this is not working , what i doing wrong ?
You can use
(?<!System\.debug.*)'(?!.*System\.debug)[^']*'
See the regex demo and the Visual Studio Code demo & settings:
Details:
(?<!System\.debug.*) - a negative lookbehind that fails the match if there is System.debug and any zero or more chars other than line break chars as many as possible immediately to the left of the current location' - a ' char(?!.*System\.debug) - a negative lookahead that fails the match if there is any zero or more chars other than line break chars as many as possible and then System.debug immediately to the right of the current location[^']* - zero or more chars other than '' - a ' char.NOTE: In VSCode regex, [^'] and other negated character classes only match line breaks if there is \r or \n somewhere in the regex pattern, so it is not necessary to use [^'\n], but it is used in the regex101 demo.