我想從URL捕獲「com.ouest.france」下面我試圖做到這一點使用這個表達式可選字符匹配字符串
play.google.com\/store\/apps\/details\?id=(.*)[?&]
見這裏http://www.rubular.com/r/NMxRo4grSL
https://play.google.com/store/apps/details?id=com.ouest.france&hl=de https://play.google.com/store/apps/details?id=com.ouest.france
但是,如果&符號不存在,則不起作用。
有什麼想法?
它是Ruby你正在使用? –
實際上是Java,但它應該很相似 –
你可以試試'play.google.com \/store \/apps \/details \?id =([^&] *)。*' –