Detect String Between Python Function Example Code Java