Execute AppleScript With Regex Via Shell

Sure. See How to Pass a Variable Into Bash Script for the trick with pbpaste after saving the current URL in your browser to the clipboard in nikivi's post.