Php Extract Number From String Python Methods