On 3/17/06 at 12:01 AM, [EMAIL PROTECTED] (Jason Davies) wrote:

>>Find: ^(\d+)$ 

>>Replace: <div class="gal-mini"><a
>>href="img/temp_05_06/tfr-\1.jpg"><img class="gen-img"
>>src="img/temp_05_06/tfr-\1-th.jpg" /></a></div>

>>If the 'temp_05_06' bit changes, you could use a second captured
>>string on each line (tab seperated, or similar), so you have two
>>things changing each time.

>Hi Jospeh

>I don't really understand how this would work - care to elaborate,
>just for interest?

The \d part represents a single digit. Adding, the '+' changes this to be a 
string of one or more digits. putting this with '(' and ')' causes the found 
sequence of digits to be memorized for use in the replacement pattern. The '^' 
represents the beginning of a line and the '$' represents the end of a line. 
So, the entire pattern represents a line with just digits on it.

Since this is the first point where a '(' and ')' pair occur, it is represented 
in the replacement pattern as /1. So, wherever you see the \1 in the 
replacement pattern is where the string of digits is placed. It might be worth 
noting since the entire matched pattern is used as a whole instead of \1 a '&' 
could have been used in the replacement pattern.

-- 
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to