TAILIEUCHUNG - Professional Information Technology-Programming Book part 102

Tham khảo tài liệu 'professional information technology-programming book part 102', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | This pattern is looking increasingly complex but it actually is not so let s look at it together. w matches any alphanumeric character but not . the valid characters with which to start an email address . After the initial valid characters it is indeed possible to have a . and additional characters although these may in fact not be present. w. matches zero or more instances of . or alphanumeric characters which is exactly what was needed. Note Think of as being the make it optional metacharacter. Unlike which requires at least one match matches any number of matches if present but does not require that any be present. is a metacharacter. To match an you ll need to escape it as . Matching Zero or One Character One other very useful metacharacter is . Like matches optional text and so zero instances will match . But unlike matches only zero or one instance of a character or set but not more than one. As such is very useful for matching specific single optional characters in a block of text. Consider the following example The URL is http to connect securely use https instead. http w. The URL is http to connect securely use https instead. The pattern used to match a URL is http which is literal text and therefore matches only itself followed by w. which matches one or more instances of a set that allows alphanumeric characters . and forward slash. This pattern can match only the first URL the one that starts with http but not the second the one that starts with https . And s zero or more instances of s would not be correct because that would then also allow httpsssss which is definitely not valid . The solution Use s as seen in the following example The URL is http to connect securely use https instead. https w. The URL is http to connect securely use https instead. The pattern here begins with https . means that the preceding character the s should be .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.