【发布时间】:2021-01-02 14:54:19
【问题描述】:
我正在尝试匹配 url,但不知道我错在哪里。我想匹配以下网址: /{type}/{location}.{upper-case-iso-code}/name.
示例:/hotel/paris.FR/belevue
我尝试使用以下表达式:
(.*\.])[A-Z]{2}
和
([]{1,}\.])[A-Z]{2}
这是我的路线:
Route::get('/hotel/{city_hotel_link}/{hotel}', 'HomeController@hotel')->where...;
【问题讨论】:
-
哪个部分与给定的正则表达式匹配?
-
我正在匹配 city_hotel_link。
-
尝试使用这个
[A-Za-z0-9]+\.[A-Z]{2}