TAILIEUCHUNG - HandBooks Professional Java-C-Scrip-SQL part 217

Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 217', 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ả | Introduction to Regexes and Pattern Matching A regular expression is a string containing a combination of normal characters and special metacharacters or metasequences. The normal characters match themselves. Metacharacters and metasequences are characters or sequences of characters that represent ideas such as quantity locations or types of characters. The list in Section shows the most common metacharacters and metasequences in the regular expression world. Later sections list the availability of and syntax for supported metacharacters for particular implementations of regular expressions. Pattern matching consists of finding a section of text that is described matched by a regular expression. The underlying code that searchs the text is the regular expression engine. You can guess the results of most matches by keeping two rules in mind 1. The earliest leftmost match wins Regular expressions are applied to the input starting at the first character and proceeding toward the last. As soon as the regular expression engine finds a match it returns. See MRE 148-149 177-179. 2. Standard quantifiers are greedy Quantifiers specify how many times something can be repeated. The standard quantifiers attempt to match as many times as possible. They settle for less than the maximum only if this is necessary for the success of the match. The process of giving up characters and trying less-greedy matches is called backtracking. See MRE 151-153. Regular expression engines have subtle differences based on their type. There are two classes of engines Deterministic Finite Automaton DFA and Nondeterministic Finite Automaton NFA . DFAs are faster but lack many of the features of an NFA such as capturing lookaround and non-greedy quantifiers. In the NFA world there are two types Traditional and POSIX. DFA engines DFAs compare each character of the input string to the regular expression keeping track of all matches in progress. Since each character is examined at most once .

Đã 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.