from django.conf.urls import *
from corehq.messaging.smsbackends.smsgh.views import SMSGHIncomingView

urlpatterns = patterns('corehq.messaging.smsbackends.smsgh.views',
    url(r'^sms/(?P<api_key>[\w-]+)/$', SMSGHIncomingView.as_view(), name=SMSGHIncomingView.urlname),
)

@@ -198,16 +198,17 @@
 %5B%5Cw-%5D+)/
+?
 $', SMSG

Make slash optional