The cstring: tokenize () and afxextractsubstring () functions are used to intercept strings with specific delimiters. Some differences are worth noting.
Cstringt tokenize (pcxstr psztokens, Int istart) const;
Bool afxapi afxextractsubstring (cstring rstring, lpctstr lpszfullstring, int isubstring, tchar chsep = '\ n ');
Cstring: pcxstr psztokens in tokenize
Calculated: not selector end position (that is, the right bracket position) 22
The Code is as follows:
Match [0] = match [0]. slice (0, excess );Match [2] = unquoted. slice (0, excess );
Calculate the complete: not selector string (match [0]) and the string in the brackets (match [2]), which are equal:
Match [0] = ": not (. class: contain ('span '))"
Match [2] = ". class: contain ('span ')"
The Code i
= soFar.slice(matched.length);Delete soFar variable: contain ('span '). At this time, soFar =): eq (3), and then, until the for loop ends, and execute the while loop again, there is no valid selector, so the while loop is exited.
return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) :tokenCache(selector, groups).slice(0);Because parseOnly = true at this time, return the soFar length of 6 at this time, continue to execute the preFilters [PSEUDO do] Code
else if (unquoted rpseudo.
time, soFar = "): eq (3)", and then runs the while loop again until the for loop ends, there is no valid selector, so the while loop is exited.
return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) :tokenCache(selector, groups).slice(0);Because parseOnly = true at this time, return the soFar length of 6 at this time, continue to execute the preFilters ["PSEUDO"] Code
Assign 6 to the excess variable, and then the code
Calculated: not selector end position (that is, the right br
follows:Excess = unquoted. indexOf (")", unquoted. length-excess)-unquoted. length
Calculated: not selector end position (that is, the right bracket position) 22Copy codeThe Code is as follows:Match [0] = match [0]. slice (0, excess );Match [2] = unquoted. slice (0, excess );
Calculate the complete: not selector string (match [0]) and the string in the brackets (match [2]), which are equal:
Match [0] = ":
] = match[0].slice (0, excess);
MATCH[2] = unquoted.slice (0, excess);
The complete: not selector string (Match[0]) and the string within the parentheses (MATCH[2) are computed separately to equal:
Match[0] = ": Not (. Class:contain (' span '))"
MATCH[2] = ". Class:contain (' span ')"
Copy Code code as follows:
Return Match.slice (0, 3);
Returns a copy of the first three
JQuery selector code (3) -- tokenize method, jquerytokenize
Original article. Please indicate the source for reprinting. Thank you!
/** The tokenize method is the core function of selector parsing, which converts the selector into two-level array groups * example: * If the selector is "div. class, span, the parsed result is: * group [0] [0] = {type: 'tag', value: 'div ', matches: match} * group [0] [1] = {
The * * Tokenize method is the core function of the selector resolution, which converts the selector to a two-level array groups * For example: * If the selector is "Div.class,span", then the result of parsing is: * Group[0][0] = {type: ' TAG ', V Alue: ' div ', matches:match} * group[0][1] = {type: ' class ', Value: '. Class ', Matches:match} * group[1][0] = {type: ' TAG ', Valu E: ' span ', matches:match} * by the above results, we can see that each
JQuery selector source code (3): tokenize method, jquerytokenize
/** The tokenize method is the core function of selector parsing, which converts the selector into two-level array groups * example: * If the selector is "div. class, span, the parsed result is: * group [0] [0] = {type: 'tag', value: 'div ', matches: match} * group [0] [1] = {type: 'class', value :'. class ', matches: match} * group [1] [0] =
Original articles, reproduced please specify the source, thank you!/* * The Tokenize function is the core function of the selector resolution, which converts the selector to a two-level array groups * Example: * If the selector is "Div.class,span", then the parsed result is: * group[0][0] = {type: ' TAG ', Value: ' div ', matches:match} * group[0][1] = {type: ' class ', Value: '. Class ', Matches:match} * group[1][0] = {type: ' TAG ' , value: ' Span '
expressions have intersection, you need to ignore the part belonging to the child/if (matchexpr["Child"].test (match[0)) {return null;
* * * If the value in parentheses is enclosed in quotation marks (Match[3]), the * assigns the value (MATCH[4) except the quote to MATCH[2].
* Match[3] represents quotation marks.
*/if (match[3] match[4]!== undefined) {match[2] = match[4]; else if (unquoted/* Rpseudo.test (unquoted): Used to test whether the unquoted contains pseudo classes, * If a pseu
This article mainly introduces the jQuery selector source code (4): Expr of the tokenize method. preFilter. This article explains the Expr of the tokenize method in detail. the source code of the preFilter implementation. For more information, see Expr. preFilter is a preprocessing method for ATTR, CHILD, and PSEUDO selectors in the tokenize method. The details a
This article mainly introduces the jQuery selector source code (4): Expr of the tokenize method. preFilter. This article explains the Expr of the tokenize method in detail. the source code of the preFilter implementation. For more information, see Expr. preFilter is a preprocessing method for ATTR, CHILD, and PSEUDO selectors in the tokenize method. The details a
excess, unquoted =! Match [5] match [2];/** because the matching Regular Expression of pseudo and child has an intersection, ignore the child part */if (matchExpr ["CHILD"]. test (match [0]) {return null;}/** if the values in the brackets are enclosed by quotation marks (match [3, * The value except the quotation marks (match [4]) is assigned to match [2]. * Match [3] indicates quotation marks. */If (match [3] match [4]! = Undefined) {match [2] = match [4];} else if (unquoted/** rpseudo. test
When compiling lexer or parser, except lexer and parser, tokenize and tokenizer often appear, basically all source code that involves lexical parsing will use tokenize.
It is named by developers who use English. Otherwise, the name may be replaced by other simple words and will not be visualized, therefore, different languages and cultures may lead to different ways of thinking. Therefore, Chinese people's
PIP installation tool times wrong reminder: Command "/usr/bin/python-u-C" Import setuptools, tokenize;__file__= '/tmp/pip-build-f8m_zq/statsmod
The reason is that you need to crawl the Web page to process HTTPS when you install the toolkit, while processing HTTPS relies on the decryption algorithm (i.e. the cryptography packet), and the cryptography relies on the Fourier transform algorithm and the corresponding compilation environment. Ubuntu 16.04
If you return to List,resulttype= "String", if you need to return to the list
2.
To return to the map, you can know key and value in the following way
The following has not yet been tried.or list
This sets the return type to resultclass= "Java.util.HashMap" and executes the query when queryForListList
Use java String class getBytes (String charsetName) and String (byte [] bytes, String charsetName) to solve the garbled problem, string. getbytes
How to store String data in Java, you can see from the source code that the
Baidu's interviewer askedString a= "ABC";String B=new string ("ABC");These two values, a, B are equal, if all go inside HashSet, can put down?A: A==b, but A.equals (B) is equal, because it is equal, so all go to hashset inside, can only put aThis problem involves the concept of a constant pool,Q: What is the difference between string Str=new
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.