fork(2) download
  1. import re
  2. text = 'Codes like 123/456\n \n123/3456 \n123/23456\n etc are correct'
  3. print( re.findall(r'(?<![^\s\n])\d{3}[./]\d{3,6}(?:/\d{3})?(?![^\s\n])', text) )
  4.  
Success #stdin #stdout 0.02s 9556KB
stdin
Standard input is empty
stdout
['123/456', '123/3456', '123/23456']