On Sep 28, 1:15 am, Bruce Van Allen <[email protected]> wrote:
> On 2010-09-26, Coffeeman wrote:
> >Hi Guys,
>
> >I manage huge keyword lists and need to be able to find and replace
> >words with multipul different words without doing it manualy.
>
> >EG
> >List
>
> >I ride bikes on monday
> >I ride motorbikes on monday
> >I walk the dog on monday
> >I eat fish on monday
>
> >I would like to find and replace monday with every other day of the
> >week without entering each day in and doing a find and replace for
> >each day one by one. Is there some sort of mass dump I can use to put
> >all the days as replacements and generate the list with all days
> >involved?
>
> Sure.
>
> find:
> ^(.*?)monday(.*)\r
>
> replace:
> \01monday\02\r\01tuesday\02\r\01wednesday\02\r\01thursday\02\r\01friday\02\ 
> r\01saturday\02\r\01sunday\02\r
>
> \01 is what's captured in the first parentheses (before
> 'monday'), and \02 has whatever is captured by the second parens
> (after 'monday' up to \r, the 'newline'). This allows you to do
> this operation when 'monday' isn't the last thing on the line.
>
> Using this, your example is transformed from
>
> I ride bikes on monday
> I ride motorbikes on monday
> I walk the dog on monday
> I eat fish on monday
>
> to
>
> I ride bikes on monday
> I ride bikes on tuesday
> I ride bikes on wednesday
> I ride bikes on thursday
> I ride bikes on friday
> I ride bikes on saturday
> I ride bikes on sunday
> I ride motorbikes on monday
> I ride motorbikes on tuesday
> I ride motorbikes on wednesday
> I ride motorbikes on thursday
> I ride motorbikes on friday
> I ride motorbikes on saturday
> I ride motorbikes on sunday
> I walk the dog on monday
> I walk the dog on tuesday
> I walk the dog on wednesday
> I walk the dog on thursday
> I walk the dog on friday
> I walk the dog on saturday
> I walk the dog on sunday
> I eat fish on monday
> I eat fish on tuesday
> I eat fish on wednesday
> I eat fish on thursday
> I eat fish on friday
> I eat fish on saturday
> I eat fish on sunday
>
> HTH
>
>     - Bruce
>
> _bruce__van_allen__santa_cruz_ca_



Hi Bruce,

Your idea is a great one and works well. I had to remove the ^ tag
from monday though. Thanks a million!


- Brendan

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to