Linked by Eugenia Loli on Sun 30th Jul 2006 20:57 UTC
.NET (dotGNU too) Regardless of what type of data you're working with or what kind of application you're creating, you will undoubtedly need to work with strings. No matter how the data is stored, the end user always deals in human-readable text. As such, knowing how to work with strings is part of the essential knowledge that any .NET developer needs to make rich and compelling applications. In addition to showing you how to work with strings in the .NET Framework, this chapter will also introduce you to regular expressions. Also, Jeff Cogswell explains how to use regular expressions to simplify and enhance the power of your programmatic string searching, matching, and replacing.
Order by: Score:
v ?
by korpenkraxar on Sun 30th Jul 2006 21:27 UTC
worst. informit link. ever.
by Cloudy on Sun 30th Jul 2006 22:30 UTC
Cloudy
Member since:
2006-02-15

Congratulations. You have linked to an article that claims to be about regular expressions which has NO discussion of regular expressions in it.

Then you followed it up with an article that supposedly explains regular expressions but only muddies the water by confusing the uninitiated about the difference between naive pattern matching and regular expressions.

Please stop. Informit articles suck.

Reply Score: 5

RE: worst. informit link. ever.
by Eugenia on Sun 30th Jul 2006 22:33 UTC in reply to "worst. informit link. ever."
Eugenia Member since:
2005-06-28

I don't know if you expected a whole book of discussion about regular expressions, but these two links (which are actually parts of book chapters) have enough info to get you started.

Reply Score: 1

RE[2]: worst. informit link. ever.
by Cloudy on Sun 30th Jul 2006 23:19 UTC in reply to "RE: worst. informit link. ever."
Cloudy Member since:
2006-02-15

No. They have enough misinformation to have you confuse pattern replacement patterns with regular expersions.

I've seen discussions of regular expressions in fewer words that did a better job and didn't cause people to confuse them with the '*' and '?' glob patterns.

Nor do these discussions give you enough to get started, as they don't even cover all of the syntax in the example they gave.

Writing an example that you don't even explain is lousy exposition. period.

http://www.regular-expressions.info/tutorial.html which is the first hit in google for regular expression tutorial is far better and doesn't try to confuse people by comparing regexps to something they're not.

Reply Score: 5

alcibiades Member since:
2005-10-12

Probably none of you need introductory material to regular expressions, but if you know anyone who does, RegexBuddy, whose tutorial is Cloudy's cited link, is a great (non-free) package if you are learning the things. Or there is the material in Robbins books on Awk which have very nice compact explanations. Though I found the Aho book on Awk much better to learn Awk itself from.

Reply Score: 1

ThanhLy Member since:
2006-03-14

RE: RegexBuddy

I use The Regex Coach (http://weitz.de/regex-coach/) which is free, or donationware I should say.

Reply Score: 1

Ruby and reg exress
by Reader on Mon 31st Jul 2006 02:26 UTC
Reader
Member since:
2005-11-08

If you want a detailed listing of all regular expressions check the "Programming Ruby" book (the standard Ruby reference. Also it is very easy to play with ruby because they have them built in! Sorry if I am a little off topic but I am learning Ruby lately and it is so impressive!

Reply Score: 2

v Guilty
by TDavis on Mon 31st Jul 2006 02:27 UTC
RegEx...
by BlackTiger on Mon 31st Jul 2006 04:04 UTC
BlackTiger
Member since:
2005-07-22

IMHO "SQL-like" syntax would be MUCH MORE usefull for regular expressions. Existing syntax is...crap. It's just like some kind of weird cipher, very hard to use and understand.

Reply Score: 1

RE: RegEx...
by Cloudy on Mon 31st Jul 2006 04:31 UTC in reply to "RegEx..."
Cloudy Member since:
2006-02-15

IMHO "SQL-like" syntax would be MUCH MORE usefull for regular expressions. Existing syntax is...crap. It's just like some kind of weird cipher, very hard to use and understand.

If you mean by "SQL-like" the syntax SQL uses for the LIKE clause, that's exactly the same pattern matching syntax that 'wildcards' use, except with '?' replaced by '_' and '*' replaced by '%'.

As far as I know, SQL doesn't have regex matching, although, apparently, most SQL implementations have one non standard form or another. MySQL uses unix regexp syntax, for instance: http://dev.mysql.com/doc/refman/5.0/en/pattern-matching.html

while regular expression syntax can be hard to read, it's actually pretty good for what it does, and no one has ever come up with a better syntax for regular-expression based pattern matching.

Reply Score: 2

RE[2]: RegEx...
by paul.michael.bauer on Mon 31st Jul 2006 14:11 UTC in reply to "RE: RegEx..."
paul.michael.bauer Member since:
2005-07-06

I don't think Cloudy is refering to the "like" clause in SQL.

I think he wants a more human language syntax for regular expressions, rather than using symbols.

E.G.

MATCH WHERE s STARTS WITH 'dog' AND ENDS WITH 'cat'

/^dog.*cat$/

Reply Score: 1

RE[3]: RegEx...
by Cloudy on Mon 31st Jul 2006 19:04 UTC in reply to "RE[2]: RegEx..."
Cloudy Member since:
2006-02-15

I don't think Cloudy is refering to the "like" clause in SQL.

I think you mean BlackTiger rather then Cloudy. ;)

I think he wants a more human language syntax for regular expressions, rather than using symbols.

Probably. Such approaches become very wordy very quickly; especially if you're using the regexp for substitution.

I can't speak for BlackTiger, but my experience with people having trouble with regexps is that they've learned how to use them by stumbling through crappy discussions like the InformIt one that are more confusing than helpful and so don't have a solid grasp of what regexps are and what they do.

It's amazing how many people don't even know that a regexp is a program in a special purpose programming language, for example; or that there are many slightly different variants on regexp syntax.

Reply Score: 1

v and "_"
by TDavis on Mon 31st Jul 2006 04:43 UTC
nice prose version of reference docs
by butters on Mon 31st Jul 2006 17:41 UTC
butters
Member since:
2005-07-08

As much as reference documentation is concise and complete, many people refuse to read it. These people want the same information rewritten in the form of book, so here you have it. This is the new trend in technical documentation: copy/paste the reference docs, put transitional sentences between the sections, and add synthetic code examples that use the functionality.

On the topic, I just find C#'s string functionality to be a little clunky, especially format strings and the StringBuilder class. I'd much rather use IronPython for text processing tasks in .NET.

Reply Score: 1