import re
text = 'Codes like 123/456\n \n123/3456 \n123/23456\n etc are correct'
print( re.findall(r'(?<![^\s\n])\d{3}[./]\d{3,6}(?:/\d{3})?(?![^\s\n])', text) )
aW1wb3J0IHJlCnRleHQgPSAnQ29kZXMgbGlrZSAxMjMvNDU2XG4gXG4xMjMvMzQ1NiBcbjEyMy8yMzQ1NlxuIGV0YyBhcmUgY29ycmVjdCcKcHJpbnQoIHJlLmZpbmRhbGwocicoPzwhW15cc1xuXSlcZHszfVsuL11cZHszLDZ9KD86L1xkezN9KT8oPyFbXlxzXG5dKScsIHRleHQpICkK