1

I have this regular expression:

(?i)((\w+\s+)(?=\s*IN\s+|\s*IN\s+OUT\s+|(?<!IN\s)(?=\s*OUT\s+)))

That find every string followed by 'in', 'in out' and 'out'. In this exemple:

 function myNestedProc(param1 in varchar2,
                       param2 out number)
    return varchar2
  is
  begin
    return param1||'_TEST';
  end;

I highlight param1 in varchar2 and param2 out number, but no *return param1||'_TEST'*. How can I capture all words equal to those captured by regular expression?

Kind Stranger
  • 1,736
  • 13
  • 18
Danieleee
  • 721
  • 1
  • 6
  • 6
  • Here is a live playground with that regex and test case: https://regex101.com/r/jQDBrf/1. Answerers can use that tool while trying to figure out the solution. – Rory O'Kane Jun 16 '17 at 21:32
  • If you want to include the ||'_TEST part, change it to `(?i)((\w+)(?=\s+IN\s+|\s+IN\s+OUT\s+|(?<!IN\s)\s+OUT\s+|\s*\|\|\s*'?_TEST))` –  Jun 16 '17 at 21:53
  • And if you want to _see_ what the assertion qualifies it, it's `(?i)((\w+)(?=(\s+IN\s+|\s+IN\s+OUT\s+|(?<!IN\s)\s+OUT\s+|\s*\|\|\s*'?_TEST)))` https://regex101.com/r/P1O2x2/1 –  Jun 16 '17 at 21:55
  • What language are you working in? – NetMage Jun 16 '17 at 22:01
  • I want to capture every other occurrence of param1 and param2 Which were previously captured. – Danieleee Jun 16 '17 at 22:20
  • It is a tmLanguage – Danieleee Jun 16 '17 at 22:23

0 Answers0