Đang chuẩn bị liên kết để tải về tài liệu:
Professional ASP.NET 1.0 Special Edition- P31

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Professional ASP.NET 1.0 Special Edition- P31:Those of us who are Microsoft developers can't help but notice that .NET has received a fair amount of visibility over the last year or so. This is quite surprising considering that for most of this period, .NET has been in its early infancy and beta versions. I can't remember any unreleased product that has caused this much interest among developers. And that's really an important point, because ignoring all the hype and press, .NET really is a product for developers, providing a great foundation for building all types of applications | Dim expr As String h e ll o Dim re As New Regex expr RegexOptions.IgnoreCase mt re.Match Hello everyone hello one and all. For Each gp In mt.Groups Response.Write br Response.Write gp.Value Next This returns the following hello ello ll There are three matches. The first is the entire match expression the second corresponds to the group within the first set of parentheses and the third is the group within the second set of parentheses. The Group class also includes Index and Length properties that indicate the position of the match within the search string and the length of string that is matched. The Capture Class The Capture class represents a single sub-expression capture. Each Group can have multiple captures. The Capture class really comes into its own when quantifiers are used within expressions. Quantifiers add an optional quantity to finding patterns. Examples of quantifiers are for zero or more occurrences and for one or more occurrences. For example consider the following expression which searches for the first occurrence of one or more 1 characters. l Putting this into a full example we have @ Page Language VB Dim mt As Match Dim gp As Group Dim cp As Capture Dim expr As String l Dim re As New Regex expr RegexOptions.IgnoreCase mt re.Match Hello everyone hello one and all. For Each gp In mt.Groups Response.Write Group gp.Value Response.Write br For Each cp In gp.Captures Response.Write Capture cp.Value Response.Write br Next Next This gives the following result Group ll Capture ll Group l Capture l Capture l Both a single 1 and multiple 1 characters are matched because the quantifier specifies one or more. So the first group matches the 11 in the first Hello. For the second group there are two occurrences of single 1 characters. This becomes clearer with another example- consider the following match expression abc This matches one or more occurrences of the string abc. When matched against QQQabcabcabcWWWEEEabcab we get the following output Group .

TÀI LIỆU LIÊN QUAN
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.