C # collection

Source: Internet
Author: User
Tags character classes

According to the design pattern, although the C # code is not systematically trained, although it can be understood in general, there are still some concepts and technical aspects that are not clear. Now that we have encountered this problem, we will record it with a lack of understanding. Without it, you can take a note.

1. Regular Expression (Interpreter Mode)

Concept: it refers to a logical formula for string operations. It uses predefined characters and combinations of these specific characters to form a "rule string ". This rule string is used to express a filtering logic for strings.

Features: 1. Strong flexibility, logic, and functionality; 2. Complex Control of strings can be achieved quickly in an extremely simple way; 3. obscure to people who are new to us.

Elements and concepts of constructing regular expressions: metacharacters, character escaping, repetition, character classes, Branch Conditions, grouping, assense, reverse reference, claim, negative 0 assertions, comments, greedy and lazy, processing options, recursive matching ...... These concepts are not resolved here, you can refer to: http://deerchao.net/tutorials/regex/regex.htm#metacode

From the official content above, it is not easy to understand what a regular expression is. In general, regular expressions are string matching rules expressed by constructing different combinations of elements. For example, you can query all files in the. DOC file system. *. Doc is a simple regular expression. For example, the search and replacement functions in notepad and word are also simple applications of regular expressions.

Ii. Abstract syntax tree (Interpreter Mode)

Concept: Abstract Syntax code (AST) is a tree representation of the abstract syntax structure of source code.

Feature: the abstract syntax tree does not depend on the syntax of the source language.

There is no concept for how to use this abstract syntax tree, and you are not very sure what it is. You can take a look at this example for your understanding. Four arithmetic expressions: 1 + 3 * (4-1) + 2, whose abstract syntax tree:

 

Iii. Reflection (Abstract Factory Model)

Definition: this is.. net ,. net Applications consist of assembly, module, and Class. Reflection provides a programming method, this allows programmers to obtain relevant information about these components during the running period.

The Assembly class can obtain information about running accessories, dynamically load the accessories, find the type information in the accessories, and create instances of this type; the type class can obtain the type information of an object. This information includes all elements of the object, such as methods, constructors, and attributes. The type class can obtain and call the information of these elements; methodinfo contains information about the method. You can use this class to obtain the name, parameter, and return value of the method and call it.
It is easy to understand: Class instantiation or getting class information when the program is running.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.