TAILIEUCHUNG - Professional Information Technology-Programming Book part 111

Tham khảo tài liệu 'professional information technology-programming book part 111', 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ả | to construct a pattern so that it contains matches that are not returned matches that are used so as to find the correct match location but not used as part of the core match. In other words you need to look around. Note This lesson discusses both lookahead and lookbehind. The former is supported in all major regular expression implementations but the latter is not supported as extensively. Java .NET PHP and Perl all support lookbehind some with restrictions . JavaScript and ColdFusion however do not. Looking Ahead Lookahead specifies a pattern to be matched but not returned. A lookahead is actually a subexpression and is formatted as such. The syntax for a lookahead pattern is a subexpression preceded by and the text to match follows the sign. Tip Some regular expression documentation uses the term consume to refer to what is matched and returned lookahead matches are said to not consume. Here is an example. The following text contains a list of URLs and you need to extract the protocol portion of each possibly so as to know how to process them . Here s the example http https ftp . http https ftp In the URLs listed the protocol is separated from the hostname by a . Pattern . matches any text http in the first match and subexpression matches . But notice that the was not matched tells the regular expression engine to match but to lookahead and not consume it . To better understand what is doing here is the same example this time without the lookahead metacharacters http https ftp . http https ftp The subexpression correctly matches but the matched text is consumed and is returned as part of the match. The difference between the two examples is that the former used pattern to match the and the latter used . Both of these patterns matched the same thing they both matched the after the protocol. The

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.