page commitment menu search

general tutorial

Home Products Web design Publications Advertising Graphics Free Quotation
 
Quick Links
Dycept RSS Feeds

Tutorials - Dycept now provide free tutorials to help solve all your Internet needs

WebDesign - Taylored web site solutions for any businesses needs

Advertising - Exciting opportunities for advertising your site at affordable prices

rss

News Headlines

Economy boost may mean pain later - Alistair Darling may be forced to set out future taxes rises to pay for a short-term boost to the economy, the BBC understands.

Johnson ponders immigrant amnesty - The Mayor of London is to commission a study of a potential amnesty for illegal immigrants in the capital.

Clinton 'will accept State post' - Hillary Clinton will agree to serve as secretary of state under US President-elect Barack Obama, the New York Times reports.

Florida boy's suicide live on web - A Florida teenager commits suicide in front of a webcam streaming live video

'No justification' for Brand show - Lewd calls from Russell Brand and Jonathan Ross to actor Andrew Sachs had "no editorial justification", the BBC Trust says.

Problem:

Lets say that you have a large amount of data that you need to sort through and make changes to only certain ones. Obviously simple search will allow you to find each entry and then manually change them but there is a much better method... round of applause and in step Regular Expressions.

Solution:

Regular Expressions allow you to do intelligent search and replace using customizable pattern matching. Most people will be familiar with regular expressions through Grep in the linux CLI (Command Line Interface) but we are just going to look at regular expressions in Dreamweaver and the free Notepad ++ Lets look at an example:

1. some random text

now lets say that you wanted the 1. in bold - well that easy you do a search for: 1. and replace with :<b>1.</b> or you could simply type it in.
Ok so far but now lets make our problem a little more complex.

1. some random text
2. some random text
3. some random text
4. some random text
...................
8. some random text


now lets say that you wanted the all the numbers at the start of the line bold. The old search and replace method becomes useless because you will be running a search per line. what you need is a regular expression.

Example:

Now when you search look for ([0-9]). and replace with <b>$1.</b> the ouput will then be:

1. some random text
2. some random text
3. some random text
4. some random text
..........................
8. some random text


This is will work fine in Dream weaver but if you want it to work in Notepad ++ you will need to use \1 instead of $1.

All the best, David Batey.

Back | Order