Google Answers Logo
View Question
 
Q: Using regular expressions in Homesite 5.0 extended replace feature ( Answered 5 out of 5 stars,   0 Comments )
Question  
Subject: Using regular expressions in Homesite 5.0 extended replace feature
Category: Computers > Programming
Asked by: mrbula-ga
List Price: $25.00
Posted: 07 Jun 2003 20:18 PDT
Expires: 07 Jul 2003 20:18 PDT
Question ID: 214551
Using regular expressions in Homesite 5.0's extended replace feature,
I want to delete all characters (including tags) up to (but not
including) the first occurrence of the word "foo."  I do not know what
characters or tags will precede "foo."  What regular expression string
should I use to achieve this?
Answer  
Subject: Re: Using regular expressions in Homesite 5.0 extended replace feature
Answered By: webadept-ga on 07 Jun 2003 23:10 PDT
Rated:5 out of 5 stars
 
Hi, 

Regular Expressions are very cool by the way, and they save a tone of
time.

So in this example line :

<br><p><img src=mypic.jpg>My Summer home called Foo House</p> <hr>

we want this replaced to read :

<p>My Summer home. The Foo House</p>

To do this with a regular expression

[A-Za-z0-9_ ><.="']*Foo

In the search and what you want to replace it with in the Replace box

What this means is 

[A-Za-z0-9_ ><.="']  == These Characters.. any of them in any
combination

* = As many as you find

Foo == in front of this set of character

This interpreter they have for the Homesite program is a little
disappointing. I have to admit I got rather excited that they had this
now and didn't mind downloading the demo version to see it in action.
But the examples are rather pour and the expressions themselves don't
act quite right.

I wish I could find some better documentation for you on how Regular
expressions work. There are a number of pages out there, but they
aren't quite right for this apt. One, which I think is very well
written is

http://www.anaesthetist.com/mnm/perl/regex.htm

Maybe you can gleen something useful from that. 

Anyway, good luck and I'm glad I could help you this far at least. 

webadept-ga

Clarification of Answer by webadept-ga on 07 Jun 2003 23:14 PDT
Oh.. one other thing. First save a copy before you run these things
because the program doesn't save and undo for the search and replace..
believe that or not.

Also, to delete everything before Foo, use the expression I gave you
in the search box and the word Foo in the replace box. That should
work just fine.

thanks again, 

webadept-ga
mrbula-ga rated this answer:5 out of 5 stars
This was enough to get me where I needed to go.  Thanks!

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy