Add error checking and more precise regexp
Merge pull request #363 from vvaldez/enhance-bridge-script

Add error checking and more precise regexp