Replace multiline regexp matchers to string matchers
This commit is contained in:
parent
cad128a4c2
commit
15f52909ed
|
@ -203,7 +203,7 @@ end
|
|||
Routen mit regulären Ausdrücken sind auch möglich:
|
||||
|
||||
```ruby
|
||||
get /^\/hallo\/([\w]+)$/ do
|
||||
get /\A\/hallo\/([\w]+)\z/ do
|
||||
"Hallo, #{params['captures'].first}!"
|
||||
end
|
||||
```
|
||||
|
|
|
@ -117,7 +117,7 @@ end
|
|||
Rutas con Expresiones Regulares:
|
||||
|
||||
``` ruby
|
||||
get /^\/hola\/([\w]+)$/ do
|
||||
get /\A\/hola\/([\w]+)\z/ do
|
||||
"Hola, #{params['captures'].first}!"
|
||||
end
|
||||
```
|
||||
|
|
|
@ -207,7 +207,7 @@ end
|
|||
Une route peut aussi être définie par une expression régulière :
|
||||
|
||||
``` ruby
|
||||
get /^\/bonjour\/([\w]+)$/ do
|
||||
get /\A\/bonjour\/([\w]+)\z/ do
|
||||
"Bonjour, #{params['captures'].first} !"
|
||||
end
|
||||
```
|
||||
|
|
|
@ -88,7 +88,7 @@ Az útvonalmintákban szerepelhetnek joker paraméterek is, melyeket a
|
|||
Reguláris kifejezéseket is felvehetünk az útvonalba:
|
||||
|
||||
```ruby
|
||||
get /^\/hello\/([\w]+)$/ do
|
||||
get /\A\/hello\/([\w]+)\z/ do
|
||||
"Helló, #{params['captures'].first}!"
|
||||
end
|
||||
```
|
||||
|
|
|
@ -207,7 +207,7 @@ end
|
|||
ルーティングを正規表現にマッチさせることもできます。
|
||||
|
||||
``` ruby
|
||||
get /^\/hello\/([\w]+)$/ do
|
||||
get /\A\/hello\/([\w]+)\z/ do
|
||||
"Hello, #{params['captures'].first}!"
|
||||
end
|
||||
```
|
||||
|
|
|
@ -206,7 +206,7 @@ end
|
|||
라우터는 정규표현식으로 매치할 수 있습니다.
|
||||
|
||||
``` ruby
|
||||
get /^\/hello\/([\w]+)$/ do
|
||||
get /\A\/hello\/([\w]+)\z/ do
|
||||
"Hello, #{params['captures'].first}!"
|
||||
end
|
||||
```
|
||||
|
|
|
@ -207,7 +207,7 @@ end
|
|||
Route matching with Regular Expressions:
|
||||
|
||||
``` ruby
|
||||
get /^\/hello\/([\w]+)$/ do
|
||||
get /\A\/hello\/([\w]+)\z/ do
|
||||
"Hello, #{params['captures'].first}!"
|
||||
end
|
||||
```
|
||||
|
|
|
@ -119,7 +119,7 @@ end
|
|||
Rotas podem casar com expressões regulares:
|
||||
|
||||
``` ruby
|
||||
get /^\/ola\/([\w]+)$/ do
|
||||
get /\A\/ola\/([\w]+)\z/ do
|
||||
"Olá, #{params['captures'].first}!"
|
||||
end
|
||||
```
|
||||
|
|
|
@ -88,7 +88,7 @@ end
|
|||
Rotas correspondem-se com expressões regulares:
|
||||
|
||||
``` ruby
|
||||
get /^\/ola\/([\w]+)$/ do
|
||||
get /\A\/ola\/([\w]+)\z/ do
|
||||
"Olá, #{params['captures'].first}!"
|
||||
end
|
||||
```
|
||||
|
|
|
@ -121,7 +121,7 @@ end
|
|||
Регулярные выражения в качестве шаблонов маршрутов:
|
||||
|
||||
```ruby
|
||||
get /^\/hello\/([\w]+)$/ do
|
||||
get /\A\/hello\/([\w]+)\z/ do
|
||||
"Hello, #{params['captures'].first}!"
|
||||
end
|
||||
```
|
||||
|
|
|
@ -108,7 +108,7 @@ end
|
|||
通过正则表达式匹配的路由:
|
||||
|
||||
~~~~ ruby
|
||||
get /^\/hello\/([\w]+)$/ do
|
||||
get /\A\/hello\/([\w]+)\z/ do
|
||||
"Hello, #{params['captures'].first}!"
|
||||
end
|
||||
~~~~
|
||||
|
|
Loading…
Reference in New Issue