How the regular expression matches characters outside of www

Source: Internet
Author: User
Tags learn php
Think for a long time Leng didn't want to come out [^w]{3}? Expert guidance


Reply to discussion (solution)

How do I match a character other than www?
(?! WWW) is that what it means?

How do I match a character other than www?
(?! WWW) is that what it means?
I want to match the two-level domain name except the beginning of www (?! WWW) What does this mean, WWA will be matched?

Test instructions description is not clear.
If WWW does not match, and WWW1 matches.

You can write it like this:
^(?! www$). *

!--? phpvar_dump (Preg_match ('/^ (?! www$). */', "www", $match)); Var_dump (Preg_match ('/^ (?! www$). */', "1www", $match)); Var_dump (Preg_match ('/^ (?!  www$). */', "WWW11", $match));   
The result is 0 1 1


How do I match a character other than www?
(?! WWW) is that what it means?
I want to match the two-level domain name except the beginning of www (?! WWW) What does this mean, WWA will be matched?
will not be matched


How do I match a character other than www?
(?! WWW) is that what it means?
I want to match the two-level domain name except the beginning of www (?! WWW) What does this mean, WWA will be matched?

Landlord to learn PHP's regular "negative order look around" know how to match the



How to match the characters outside www?
(?! WWW) is that what it means?
I want to match the two-level domain name except the beginning of www (?! WWW) What does this mean, WWA will be matched?

Landlord to learn about PHP's regular "negative order look around" know how to match the
ask the $ is not the end of the match what to put in here what usage

(?! www$)
$ is the end of the match meaning Ah, but (?! www$) This represents the assertion that the assertion does not have a "www end" and asserts that it does not occupy a matching space.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.