Linked by Thom Holwerda on Sat 15th Apr 2006 18:19 UTC, submitted by Mark
General Development "In this article a simple usage of regular expressions is described. Its intention is to bring users to try the most powerful search and replace paradigm available and hopefully start using it. This however can not replace good tutorials available on the sites that are also mentioned in this article. The article is written reproducing actual steps I took to complete my task, to show the specifics and possible problems."
Thread beginning with comment 115220
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE: regexp
by Hurtta on Sun 16th Apr 2006 08:25 UTC in reply to "regexp"
Hurtta
Member since:
2006-04-16

Even though it might be helpful, regexps are not something an average user needs to remember or even know about.

Secondly, even though your basic user would know about them, regexp for matching html doc type declaration is probably not amongst the most used searches ;)

Reply Parent Score: 1

RE[2]: regexp
by Havin_it on Sun 16th Apr 2006 11:14 in reply to "RE: regexp"
Havin_it Member since:
2006-03-10

I disagree. I reckon almost everybody can benefit from the ability to use regex now and again. On a very low-level example, suppose you made a faux-tabular data layout in your favourite word-processor. [You know the type; just use tabs to align the data in columns.]

You've just finished entering the data, then you realise (or your manager decides, as is often the case) the columns should be in a different order. Curses!

Now you can either commit to a hefty and time-consuming bout of line-by-line cutting and pasting, or save the chunk of data into a textfile and run a one-line sed or awk expression over it.

Well, that's how I got turned on to regex, anyway. I stress, it was a *lot* of data.

Reply Parent Score: 1

RE[3]: regexp
by alcibiades on Sun 16th Apr 2006 13:33 in reply to "RE[2]: regexp"
alcibiades Member since:
2005-10-12

Yes, this is very similar to what happened to me. Client has database of several thousand entries, and the supplier wants several hundred pounds to supply an export facility. You find a way to get the entries out into a sort of semi structured text format, but the problem is how to get that into csv. A few lines of awk will do it, or going through a few passes with a regex enabled text editor, but what else comes close in terms of speed and immediate testability?

Another case, a colleague who is heading a collaborative research project gets input from many different independent freelance researchers in all flavors of Word, most of which he can either not read or partly read, and due to formatting, tables and so on, we can't find any version of Word that will properly read them all. A few passes through with regular expressions, and you look like a miracle worker, and more important, they can get on with it.

Until you have it available, its hard to imagine how useful it is. It is an uphill struggle, but its really worth putting the time and effort in, because the first time you need it, it will all be repaid in a flash. And this is from only a smattering of knowledge of it. Now if you were a real regex guru...

One day!

Reply Parent Score: 1

RE[3]: regexp
by Morin on Sun 16th Apr 2006 14:02 in reply to "RE[2]: regexp"
Morin Member since:
2005-12-31

> Now you can either commit to a hefty and time-consuming
> bout of line-by-line cutting and pasting, or save the
> chunk of data into a textfile and run a one-line sed or
> awk expression over it.

I think you overlooked the term "average user" ;)

Reply Parent Score: 1