Javascript/RegExp: Lookbehind Assertion is causing a "Invalid group" error

I believe JavaScript does not support positive lookbehind. You will have to do something more like this:

<script>
var regex = /\#\!\/([^\/]+)/;
var url = "http://my.domain.com/index.php/#!/write-stuff/something-else";
var match = regex.exec(url);
alert(match[1]);
</script>

Javascript doesn't support look-behind syntax, so the (?<=) is what's causing the invalidity error. However, you can mimick it with various techniques: http://blog.stevenlevithan.com/archives/mimic-lookbehind-javascript