Regex, regular expressions
This article should be a squeeze for three years to come out (literally), would say, because this thing in my annual program objectives have emerged
(On behalf of every year is not reached =. =) So you can know how annoying Regex is learning,
At least for me, the learning curve a little height, looked at some of the Martian, the heart will emerge OS: ㄊ ㄋ ㄋ ㄉ
Finally will escape, and then select Hyperactivity of dismantling the string I want, just force yourself to study in the near future,
A start is to search for resources on the network, to find a "simulator" Expresso 3.0
Then find a recommended introductory article on the site brother Paul, after everything is ready to start
http://www.dotblogs.com.tw/johnny/archive/2010/01/25/13301.aspx
Looking for a day is also little knowledge (also my eight hours), do not know will not, in the analog simulator directly, it is easier to understand
as follows
As shown above, I want to parse a web page, it is to crawl
~Intuitively, the idea is that we want to crawl
beginning,therefore
1. This Pattern of (
[Srn]{0,})+2. The next step is to resolve [Srn] Please refer to the URL entry,
On behalf of [] in line with "the conditions of the parameters."
S represents symbols other than the blank. (A parameter)
rn represent a newline character. (Parameter Two)
So we can say that this data is "consistent and in line other than a blank line feed" in
3. {0,} explanation is in line 2. The number of the conditions (a bit difficult to explain this), explain too much rope URL entry system,
Later I will give a simple example of this supplement.
The current representation : matching "
Character followed by compliance (2) "other than white or line", and repeated zero or more times (3)4. Look + is not read, did not know the direct practice, that is, before the + symbol appears once or more than once are considered in line with the conditions of
5. Finally fix a
"At the beginning (1)
Conclusion: In fact, pony myself seen a lot of data on the network, but may be qualified dull, always feel on the network to explain
Such as "if and only if" This is very annoying academic terms (do not use the vernacular explanation? (╯ -_-) ╯ ~ ╩╩)
Spent a lot of time, finally might as well find yourself real quick examples do know.
Supplementary Description : Just {0} is explained with a simple example of a screen description easier to understand Keguan
Part II of this will result in practical applications on .Net paradigm.
Bascally, Regex is really difficult to explain for me. The best way is find a sample to try it.
Added: A friend shared a good analytical tool Regex online
http://www.regexper.com/
Pictured addition and subtraction for learning some help Oh!
Original: Big Box Regex - Regular expression