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.
Thread beginning with comment 147740
To view parent comment, click here.
To read all comments associated with this story, please click here.
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 Parent Score: 2

RE[2]: RegEx...
by paul.michael.bauer on Mon 31st Jul 2006 14:11 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 Parent Score: 1

RE[3]: RegEx...
by Cloudy on Mon 31st Jul 2006 19:04 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 Parent Score: 1