1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

Replace multiline regexp matchers to string matchers

This commit is contained in:
Anton Davydov 2015-02-06 00:15:53 +03:00
parent cad128a4c2
commit 15f52909ed
11 changed files with 11 additions and 11 deletions

View file

@ -203,7 +203,7 @@ end
Routen mit regulären Ausdrücken sind auch möglich: Routen mit regulären Ausdrücken sind auch möglich:
```ruby ```ruby
get /^\/hallo\/([\w]+)$/ do get /\A\/hallo\/([\w]+)\z/ do
"Hallo, #{params['captures'].first}!" "Hallo, #{params['captures'].first}!"
end end
``` ```

View file

@ -117,7 +117,7 @@ end
Rutas con Expresiones Regulares: Rutas con Expresiones Regulares:
``` ruby ``` ruby
get /^\/hola\/([\w]+)$/ do get /\A\/hola\/([\w]+)\z/ do
"Hola, #{params['captures'].first}!" "Hola, #{params['captures'].first}!"
end end
``` ```

View file

@ -207,7 +207,7 @@ end
Une route peut aussi être définie par une expression régulière : Une route peut aussi être définie par une expression régulière :
``` ruby ``` ruby
get /^\/bonjour\/([\w]+)$/ do get /\A\/bonjour\/([\w]+)\z/ do
"Bonjour, #{params['captures'].first} !" "Bonjour, #{params['captures'].first} !"
end end
``` ```

View file

@ -88,7 +88,7 @@ Az útvonalmintákban szerepelhetnek joker paraméterek is, melyeket a
Reguláris kifejezéseket is felvehetünk az útvonalba: Reguláris kifejezéseket is felvehetünk az útvonalba:
```ruby ```ruby
get /^\/hello\/([\w]+)$/ do get /\A\/hello\/([\w]+)\z/ do
"Helló, #{params['captures'].first}!" "Helló, #{params['captures'].first}!"
end end
``` ```

View file

@ -207,7 +207,7 @@ end
ルーティングを正規表現にマッチさせることもできます。 ルーティングを正規表現にマッチさせることもできます。
``` ruby ``` ruby
get /^\/hello\/([\w]+)$/ do get /\A\/hello\/([\w]+)\z/ do
"Hello, #{params['captures'].first}!" "Hello, #{params['captures'].first}!"
end end
``` ```

View file

@ -206,7 +206,7 @@ end
라우터는 정규표현식으로 매치할 수 있습니다. 라우터는 정규표현식으로 매치할 수 있습니다.
``` ruby ``` ruby
get /^\/hello\/([\w]+)$/ do get /\A\/hello\/([\w]+)\z/ do
"Hello, #{params['captures'].first}!" "Hello, #{params['captures'].first}!"
end end
``` ```

View file

@ -207,7 +207,7 @@ end
Route matching with Regular Expressions: Route matching with Regular Expressions:
``` ruby ``` ruby
get /^\/hello\/([\w]+)$/ do get /\A\/hello\/([\w]+)\z/ do
"Hello, #{params['captures'].first}!" "Hello, #{params['captures'].first}!"
end end
``` ```

View file

@ -119,7 +119,7 @@ end
Rotas podem casar com expressões regulares: Rotas podem casar com expressões regulares:
``` ruby ``` ruby
get /^\/ola\/([\w]+)$/ do get /\A\/ola\/([\w]+)\z/ do
"Olá, #{params['captures'].first}!" "Olá, #{params['captures'].first}!"
end end
``` ```

View file

@ -88,7 +88,7 @@ end
Rotas correspondem-se com expressões regulares: Rotas correspondem-se com expressões regulares:
``` ruby ``` ruby
get /^\/ola\/([\w]+)$/ do get /\A\/ola\/([\w]+)\z/ do
"Olá, #{params['captures'].first}!" "Olá, #{params['captures'].first}!"
end end
``` ```

View file

@ -121,7 +121,7 @@ end
Регулярные выражения в качестве шаблонов маршрутов: Регулярные выражения в качестве шаблонов маршрутов:
```ruby ```ruby
get /^\/hello\/([\w]+)$/ do get /\A\/hello\/([\w]+)\z/ do
"Hello, #{params['captures'].first}!" "Hello, #{params['captures'].first}!"
end end
``` ```

View file

@ -108,7 +108,7 @@ end
通过正则表达式匹配的路由: 通过正则表达式匹配的路由:
~~~~ ruby ~~~~ ruby
get /^\/hello\/([\w]+)$/ do get /\A\/hello\/([\w]+)\z/ do
"Hello, #{params['captures'].first}!" "Hello, #{params['captures'].first}!"
end end
~~~~ ~~~~