Page 1 of 1

Search and Replace question

Posted: Fri Mar 14, 2008 5:47 am
by pouliotmax
Is there a way when you do a search and replace in the whole project to automatically replace without having to click for each topic?

Re: Search and Replace question

Posted: Fri Mar 14, 2008 5:51 am
by KevinDAmery
After you start the search and it finds it's first instance, click the Replace in All Files button.

Re: Search and Replace question

Posted: Tue Mar 18, 2008 6:22 pm
by forfear
Regular expressions and wildcard documentation required.

Anyway since there aren't much writeup's about this, have a look at this. Its very usable in Flare for Search and Replace

http://www.regular-expressions.info/

When you do your search in Flare, remember to select Regular Expressions or the search won't work.

Re: Search and Replace question

Posted: Wed Mar 19, 2008 2:03 am
by NorthEast
Yep, adding something to the help to say what wildcards or regular expressions would be good.

I'm going to have to set some time aside to look at that site properly, I've looked at it twice and couldn't follow it!

Re: Search and Replace question

Posted: Wed Mar 19, 2008 7:09 am
by forfear
Dave Lee wrote:Yep, adding something to the help to say what wildcards or regular expressions would be good.

I'm going to have to set some time aside to look at that site properly, I've looked at it twice and couldn't follow it!
Have a look at the examples.

Re: Search and Replace question

Posted: Wed Mar 19, 2008 7:36 am
by NorthEast
Have a look at the examples.
Yep, I did, I think it'll just take me a while to understand them!

Re: Search and Replace question

Posted: Wed Mar 19, 2008 7:58 am
by forfear
Copy and paste

Then modify the given example ...see Grabbing HTML Tags

Code: Select all

<TAG\b[^>]*>(.*?)</TAG>
change tag with a real html tag

Re: Search and Replace question

Posted: Wed Mar 19, 2008 8:21 am
by NorthEast
Yep, I got that far, I just need to make some quite complex ones that'll require some homework.

Re: Search and Replace question

Posted: Wed Mar 19, 2008 5:43 pm
by forfear
I discovered recently that I would like to replace a block of text (code) in Flare. Unfortunately the search and replace is a line by line searcher. It doesn't search more than up to the EOL (end of line). So i wouldn't be able to create a regular expression to replace a block of text. alas.

Re: Search and Replace question

Posted: Wed Mar 19, 2008 7:05 pm
by LTinker68
If the block of text is always the same, then Analyzer will detect the duplicate text and will recommend it be converted into a snippet which will then replace the regular text. At that point you could edit the snippet and it will filter to all instances of it in the project.

BTW, in Flare, if you tell it to search in source code, then it searches in the source code for the page instead of the content only as it appears in the XML Editor. So it won't stop at the end of the line like it might in the XML Editor, but it will stop at a tag (unless you include the tag in the search parameters). So if you're replacing one long line of text (or even a paragraph), then you should be able to do it in Flare, so long as you tell it to search in the source code.

Note... I've never searched for a block of text, so I'm not sure if Flare's find field has a character limit.

Re: Search and Replace question

Posted: Thu Mar 20, 2008 6:13 am
by forfear
I believe it doesnt search beyond a line. You got it right i am searching to replace a chunk of text in the source code. Replacing a paragraph of 'content' text isn't a problem.

Re: Search and Replace question

Posted: Tue Apr 22, 2008 10:40 am
by neeirish
I am trying to use the Find and Replace functionality to search through all of the files in the project to replace specific character tags, for example, find: "frontpanel" replace with: "bold". I selection Find in (whole project), and when I then click find next, the editor tells me it needs to open in text view (because I'm asking to search source code", but it will not search the entire project. I get the message "Recahded the end of the search", however I know for a fact that this text is contained in many other files, but it doesn't seem to look. Why is this? Is there any way to do a full search and replace function on the source? :(

Re: Search and Replace question

Posted: Tue Apr 22, 2008 10:57 am
by KevinDAmery
There is a pulldown that by says "Current Topic": change it to "Whole Project". You'll also need to use the Replace in All Files button.

Re: Search and Replace question

Posted: Tue Apr 22, 2008 4:20 pm
by forfear
neeirish wrote:....specific character tags, for example, find: "frontpanel" replace with: "bold". I selection Find in (whole project), and when I then click find next, the editor tells me it needs to open in text view (because I'm asking to search source code", but it will not search the entire project. I get the message "Recahded the end of the search", however I know for a fact that this text is contained in many other files, but it doesn't seem to look. Why is this? Is there any way to do a full search and replace function on the source? :(

I assume the text you want to modiy is found in the 'topic' source code. Easy 1,2,3. Otherwise in Find and Replace pane, change the 'File types' option
Click Start to locate instances in your projects.
If any instances are found, the summary of results are shown. If none are shown try changing Find to '*fronpanel'. Enable wildcards.
Then click Replace or Replace All.
The picture below should help summarize the discussion going on in all the posts.

Re: Search and Replace question

Posted: Tue Apr 22, 2008 11:00 pm
by NorthEast
Yep, you need to click Start.

This caught me out too when I first used it, it is really unintuitive.