regex - Regular Expressions: Get subdomain and domain -


in nginx, have line states ~^(www\.)(?<sub>.+).(?<domain>.+)$.

how make can subdomain , domain separate? subdomain.example.com.

edit: tried ~^(www\.)?(?<sub>)\.?(?<domain>.+)$ , didn't work either.

you have escape .

~^(www\.)?(?<sub>.+?)\.(?<domain>.+)$ 

Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -