Professional Information Technology-Programming Book part 112

Tham khảo tài liệu 'professional information technology-programming book part 112', 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ả | CFMX1 XTC99 Total items found 4 0-9. ABC01 HGG42 CFMX1 XTC99 Total items found 4 That did the trick. matches but does not consume it and so only the prices without the leading signs are returned. Compare the first and last expressions used in this example. 0-9. matched followed by a dollar amount. 0-9. also matched followed by a dollar amount. The difference between the two is not in what they located while performing the search it is in what they included in the results. The former located and included the . The latter located so as to correctly find the prices but did not include that in the matched results. Lookahead patterns may be variable length they may contain . and for example so as to be highly dynamic. Lookbehind patterns on the other hand must generally be fixed length. This is a restriction imposed by almost all regular expression implementations. Combining Lookahead and Lookbehind Lookahead and lookbehind operations may be combined as in the following example the solution to the problem at the start of this lesson HEAD TITLE Ben Forta s Homepage TITLE HEAD tT iI tT lL eE . tT iI tT lL eE HEAD TITLE Ben Forta s Homepage TITLE HEAD That worked. tT iI tT lL eE is a lookbehind operation that matches but does not consume TITLE tT iI tT lL eE similarly matches but does not consume TITLE . All that is returned is the title text as that is all that was consumed . Tip In the preceding example it may be worthwhile to escape the the first character being matched to prevent ambiguity so instead of . Negating Lookaround As seen thus far lookahead and lookbehind are usually used to match text essentially to specify the location of text to be returned by specifying the text before or after the desired match . These are known as positive lookahead and positive lookbehind. The term positive refers to the fact that they look for a match. A lesser-used form of lookaround is the negative lookaround. Negative lookahead looks ahead for

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
33    78    1    12-06-2024
535    4    1    12-06-2024
Đã 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.