L
L
lexstile2019-06-09 20:48:34
Regular Expressions
lexstile, 2019-06-09 20:48:34

How to add a limited number of spaces to a regular expression (.htaccess)?

.htaccess:

RewriteRule ^text/([абвгдеёжзийклмнопрстуфхцчшщьыъэюяАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЬЫЪЭЮЯ\ {0,1}]+)?$ /app/text/detail.php?t=$1 [L]

Must process url: test%20test (<= 1 space)
And must not process: test%20%20test (> 1 space)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-06-09
@lexstile

RewriteRule ^text/((\xd0[\x81\x90-\xbf]|\xd1[\x80-\x91])+(?:\s(?2)+)*)/?$ /app/text/detail.php?t=$1 [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question