私はこのようなjQueryのモバイルURLのハッシュフラグメントに一致するようにしようとしている。しかし、問題は、それは次のように扱われますので、#記号がコンパイルJSファイル内の正規表現からみじん切りしまうことですCoffeeScript heregexの一部として#を使用する方法?
matches = window.location.hash.match ///
# # we're interested in the hash fragment
(?:.*/)? # the path; the full page path might be /dir/dir/map.html, /map.html or map.html
# note the path is not captured
(\w+\.html)$ # the name at the end of the string
///
コメントの開始。私は正規の正規表現に切り替えることができますが、ここで#を使用する方法はありますか?
偉大な、これは私が必要なものです。私は\#が保持されているのを見ましたが、#と同じことは分かりませんでした。 –