fork download
  1. import re
  2. variable = 'get the ONE TWO THREE get FOUR FIVE'
  3. myVariableSearch = re.search(r'\bget\s+the\s+(.*?)(?=\s*\bget\b|$)', variable)
  4. mySearchGroup = ''
  5. if myVariableSearch:
  6. mySearchGroup = myVariableSearch.group(1)
  7. print(mySearchGroup)
  8.  
Success #stdin #stdout 0.02s 9456KB
stdin
Standard input is empty
stdout
ONE TWO THREE