24: Word Length, 24: Word Length24: Word Length
View
Submit
Statistics
Question
Total time limit:
1000 ms
Memory limit:
65536kB
Description
Enter a word sequence. adjacent words are separated by one or more spaces. Calculate the length of each word accordingly.Note: if there is a punctuation mark (such as a hyphen or comma), the
of the text line.Value: none | [underline (underline) | overline (upper line) | line-through (middle line)] | inheritInitial Value: noneText wrap word-wrapThe browser provides the Text wrap function. The text container can wrap automatically on the right.For English, the browser will automatically wrap the line in a space or a hyphen, instead of a sudden line break in the middle of the word.For Chinese, you can wrap a line after any text, but when a
, where the hyphen (-) is the range of consecutive characters, and the ^ symbol appears in the first position of the square brackets, indicating that the match is not any character in the list;
Only characters in POSIX Bre
\{n,m\}: An interval expression that matches the number of occurrences of a single character before it. \{n\} refers to reproducing n times; \{n,m\} refers to reproducing N to M times;
\ (\): Reserve space
text in the Web page can produce a corresponding adjustment, respecting the relationship between different text sizes.
11 Control line Wrapping
FF Spinoza by Max Phillips
Zooming the browser window makes the text box spacious or crowded, and end users can also change the font size. This may make you think that line-shifting is difficult to control. But when you have a thorough understanding of the desired end result, certain aspects can be manipulated.
A newline occurs at the
pattern, for example, matches the string "Once Upon a Time" and does not match the "There once was a mans from NewYork". Just as the ^ symbol indicates the beginning, the $ symbol is used to match the strings that end in the given pattern.
bucket$
This pattern matches the "who kept all of the this cash in a bucket" and does not match "buckets". Characters ^ and $ are used at the same time to represent exact matches (strings are the same as patterns). For example:
^bucket$
Matches only the strin
, for example, matches the string "Once Upon a Time" and does not match the "There once was a mans from NewYork". Just as the ^ symbol indicates the beginning, the $ symbol is used to match the strings that end in the given pattern.
bucket$
This pattern matches the "who kept all of the this cash in a bucket" and does not match "buckets". Characters ^ and $ are used at the same time to represent exact matches (strings are the same as patterns). For example:
^bucket$
Matches only the string "b
once. This pattern, for example, matches the string "Once Upon a Time" and does not match the "There once was a mans from NewYork". Just as the ^ symbol indicates the beginning, the $ symbol is used to match the strings that end in the given pattern.
bucket$
This pattern matches the "who kept all of the this cash in a bucket" and does not match "buckets". Characters ^ and $ are used at the same time to represent exact matches (strings are the same as patterns). For example:
^bucket$
Matches
Find
Find in string
String.find ("CDCDCDCD", "AB")
Nil
String.find ("CDCDCDCD", "CD")
1 2
String.find ("CDCDCDCD", "CD", 7)
7 8
Gsub
Replace in string
String.gsub ("Abcdabcd", "a", "Z");
ZBCDZBCD 2
String.gsub ("AAAA", "a", "Z", 3);
Zzza 3
Byte
Returns the integer form of the character
String.byte ("ABCD", 4)
68
Char
Converts an integer number to a character an
Regular Expression, Regular Expression
Regular ExpressionRegular Expressions are tools used to describe these rules. In other words, a regular expression is the code that records text rules.
========================================================== ======\ B is a special code specified by a regular expression that matches only one position.If you are looking for a Lucy not far behind hi, you should use \ bhi \ B. * \ bLucy \ B.
. Is another metacharacters that match any character except the lin
with once. For example, the pattern matches the string "Once Upon a Time" and does not match "there once is a man from NewYork". Just as the ^ symbol represents the beginning, the $ symbol is used to match strings that end in a given pattern.
bucket$
This pattern matches the "who kept all of the cash in a bucket" and does not match "buckets". The characters ^ and $ are used together to indicate exact matches (the string is the same as the pattern). For example:
^bucket$
Matches only the string
. * \ blucy \ BThe meaning is obvious:First, a word hi, then any character (but not a line break), and finally Lucy..
"\ D"Is a new metacharacters, matchingAny number (0, or 1, or 2, or ......)."-"It is not a metacharacter. It only matches itself-the font size.
0 \ D-\ DMatch the following string:It starts with 0, followed by two numbers, followed by a hyphen (-), and finally eight numbers.(Chinese phone number. Of course, this example can only mat
instead of punctuation marks.Hyphens are used only on special occasions. For example: antisense encoded protein genes can be added to the identity of the hyphen (Bace1-as is the name of BACE1 Antisenserna).The letters in lncRNA's name should be uppercaseThe letters in the human genome should be capitalized in order to differentiate them from the genes of other species (e.g., the rodent gene's identity requ
Positive expressionSuppose you look for hi in an English novel, you can use regular expressions hi\b is a special code (meta-character) of a regular expression that represents the beginning or end of a word, which is where the word is broken down. Although the commonly expected words are delimited by spaces, punctuation, or line breaks, \b does not match any one of these word-delimited characters, it only matches one position.Example\bhi\b.*\blucy\b =
Eregi_replace () are also useful: if we want to replace all the interval minus signs with commas:Ereg_replace ("[\n\r\t]+", ",", Trim ($STR));Finally, I put another string of check email regular expression to see the article you to analyze."^[-!#$%\ ' *+\\./0-9=?" A-z^_ ' a-z{|} ~]+ '. ' @‘.‘ [-!#$%\ ' *+\\/0-9=? A-z^_ ' a-z{|} ~]+\. '. ' [-!#$%\ ' *+\\./0-9=? A-z^_ ' a-z{|} ~]+$"If it is easy to read, then the purpose of this article is achieved.Syntax rules for JScript and VBScript regular ex
string that contains the pattern. For example: mode
Once
and string
There once was the man of the newyork who kept all of the cash
.
is a match.
The letters in the pattern (O-N-C-E) are literal characters, that is, they represent the letter itself, and the number is the same. Some other slightly more complex characters, such as punctuation and white space (spaces, tabs, and so on), use the escape sequence. All escape sequences begin with a ba
itself
. (point): pairing with any character%a: Pairing with any letter%c: Pairing with any of the controls (for example \ n)%d: Pairing with any number%l: Pairing with any lowercase letter%p: Paired with any punctuation (punctuation)%s: Pairing with white-space characters%u: Pairing with any uppercase letters%w: Pairing with any letter/digit%x: Pairing with any hexadecimal number%z: Pairing with any char
only those strings that start with once. This pattern, for example, matches the string "Once Upon a Time" and does not match the "There once was a mans from NewYork". Just as the ^ symbol indicates the beginning, the $ symbol is used to match the strings that end in the given pattern.
bucket$
This pattern matches the "who kept all of the this cash in a bucket" and does not match "buckets". Characters ^ and $ are used at the same time to represent exact matches (strings are the same as pattern
format or regular expression constructor
Text Format:/pattern/flags
Regular expression constructor: New RegExp ("pattern" [, "flags"]);
Parameter description:
Pattern--a regular expression literal
Flags--if present, will be the following values:
G: Global Match
I: Ignore case
GI: Above combination
M: multiple-line matching
[note] The arguments in the text format do not use quotation marks, but the arguments that are used when using the constructor require quotes.
1 Direct measure characters
contains a special character ^, which indicates that the pattern matches only those strings that start with once. This pattern, for example, matches the string "Once Upon a Time" and does not match the "There once was a mans from NewYork". Just as the ^ symbol indicates the beginning, the $ symbol is used to match the strings that end in the given pattern.
bucket$
This pattern matches the "who kept all of the this cash in a bucket" and does not match "buckets". Characters ^ and $ are used at
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.