Regular expressions in server_name: pattern length

Phillip Oldham phill at activityhq.com
Wed Dec 9 12:44:01 MSK 2009


Igor Sysoev wrote:
> On Wed, Dec 09, 2009 at 09:21:24AM +0000, Phillip Oldham wrote:
>
>   
>> Is it possible to capture the length of a particular pattern in the 
>> server_name section?
>>
>> For example, I'm having trouble getting the following to match:
>>
>> server_name ~([a-z]{2,3})?\d{3,6}\.mysite\.org;
>>
>> I'm using 0.7.62.
>>     
>
> Do you mean how to learn the caputured data length ? No way.
>   

To clarify, I'm looking to be able to capture:

asd12345.mysite.org
xy789.mysite.org

but using a separate rule capture:

client1.mysite.org
anotherclient.mysite.org

for a different `server` block.

This is not possible then?



More information about the nginx mailing list