Wildcards and regular expressions support in Flare 7

This forum is for all Flare issues not related to any of the other categories.
Post Reply
jivana
Propeller Head
Posts: 25
Joined: Mon Aug 24, 2009 5:02 pm
Location: Byron Shire, NSW, Australia

Wildcards and regular expressions support in Flare 7

Post by jivana »

Flare claims to support regular expressions, however I find the documentation more than inadequate:
Use This is an advanced feature for users who are familiar with wildcard and regular expressions in searches. If you select this check box, you can specify whether the search will include wildcards or regular expressions.
I am pretty sure there are a number of 'advanced' users here who would love to use the feature, however without more information, it is close to impossible:
What are the wildcard characters that Flare supports? Have they changed in newer versions?
I only heard about the asterisk (*).

What flavour of regular expressions does Flare support?
This would be a start, because then at least one could find resources elsewhere

Can it just find or also replace?
Some users stated here that it cannot replace.

Are there examples of what it can or cannot do?
Again, there is a lot of heresay in the foums which does not really help.

Can we have someone from the Flare team give us a definite answer on how far support for wildcards and regular expressions really goes?
How come nobody knows anything about it?
I am getting the sneaky suspicion Flare does not really support it or the feature has not been looked at in so long nobody remembers how it works. :)

Or is the answer: Use a third-party tool instead.
That would be OK, too, but it kills me that there is a feature in Flare that could be really useful but nobody knows how to use.

Many thanks for any help.
Stefan Tober
Flare 9 on Win 7
crdmerge
Sr. Propeller Head
Posts: 248
Joined: Tue Dec 16, 2008 5:37 am

Re: Wildcards and regular expressions support in Flare 7

Post by crdmerge »

Quick test reveals:
  • Use the asterisk (*).
    Regular expressions do not work.
    It can find and replace.
What it cannot do is the same as RoboHelp's similar feature: it cannot find multiple words with extra spaces or line breaks separating them.

And yes, the answer is to use a third-party tool instead (we use FAR, a fantastic tool; others have reported good results with BKReplaceEm).


Good luck,
Leon
wbrisett
Sr. Propeller Head
Posts: 216
Joined: Mon Oct 05, 2009 3:29 pm
Location: Austin, TX

Re: Wildcards and regular expressions support in Flare 7

Post by wbrisett »

Flare's files are text files, so if you want to use regular expressions I would highly recommend the free text editor NotePad ++. Not only will it allow you to use regex on individual files, you can run them across entire folders or locations.

Wayne
nickatwork
Sr. Propeller Head
Posts: 457
Joined: Thu Sep 16, 2010 6:31 am
Location: London

Re: Wildcards and regular expressions support in Flare 7

Post by nickatwork »

Wildcard as far as I am aware is * (isnt that pretty standard? I've never heard of another one)

As for Regular Expressions, I have used them in Flare countless times now. Many 'common' regex's are supported. Though I have heard there are many different syntax types for regex's, I have been able to get everything I need out of regex's in Flare. This is a pretty useful test site that syntax seems to work the same as Flare. http://gskinner.com/RegExr

Regex's DO NOT work for replaces. Only Find. It is a short coming, but if you are able to use a decent enough find regex, then you can probably get around it.

Is there something particular you are wanting to achieve?
rob hollinger
Propellus Maximus
Posts: 661
Joined: Mon Mar 17, 2008 8:40 am

Re: Wildcards and regular expressions support in Flare 7

Post by rob hollinger »

crdmerge wrote:Quick test reveals:
  • Use the asterisk (*).
    Regular expressions do not work.
    It can find and replace.
What it cannot do is the same as RoboHelp's similar feature: it cannot find multiple words with extra spaces or line breaks separating them.

And yes, the answer is to use a third-party tool instead (we use FAR, a fantastic tool; others have reported good results with BKReplaceEm).


Good luck,
Leon
nickatwork is correct. Find using regular expressions works and can find multiple words on multiple lines. Replace does not support regular expressions.
Example:
Search expression: "type\s*\r*code"
\s = whitespace
\r = newline
Using the asterisk after each, you can increase the white space or the number of lines and it will still find "type code".
Code in the topic:

Code: Select all

		<p>* real time results: shows results as you type 
		code hinting: roll over your expression to see info on specific elements </p>
This site is a great tool for testing http://gskinner.com/RegExr/.
You can insert the text your looking for with line breaks ect and then test the codes.
Rob Hollinger
MadCap Software
jivana
Propeller Head
Posts: 25
Joined: Mon Aug 24, 2009 5:02 pm
Location: Byron Shire, NSW, Australia

Re: Wildcards and regular expressions support in Flare 7

Post by jivana »

Thanks for your replies, everyone.
I conclude that to replace code, you must use third-party tools.

I am not trying to do anything in particular now, but when working with large projects of 1000+ topics, it is an indispensable tool.
I have used external replace tools and still use Notepad++ for day-to-day tasks.
I hope that Flare supports replacing by regular expression one day.
Stefan Tober
Flare 9 on Win 7
cruitbuck
Propeller Head
Posts: 60
Joined: Wed May 06, 2009 8:19 am
Location: dallas
Contact:

Re: Wildcards and regular expressions support in Flare 7

Post by cruitbuck »

I was able to figure out how the Wildcard for source code Search Replace Works: for example to find and remove this string,

<MadCap:xref class="HeadingLink" href="#02commands_cws_2118762814_107311">

Use this collection of characters from the string with the * wildcard.

<MadCap:xref *c*="*" href="#*">

Apparently it punts on special characters, = ' " #. I included some of the alpha characters just to be sure. On the other hand if you simply want to change the word commands to functions write "command?" for the find field and "functions" in the replace field.

BobB


jivana wrote:Flare claims to support regular expressions, however I find the documentation more than inadequate:
Use This is an advanced feature for users who are familiar with wildcard and regular expressions in searches. If you select this check box, you can specify whether the search will include wildcards or regular expressions.
I am pretty sure there are a number of 'advanced' users here who would love to use the feature, however without more information, it is close to impossible:
What are the wildcard characters that Flare supports? Have they changed in newer versions?
I only heard about the asterisk (*).

What flavour of regular expressions does Flare support?
This would be a start, because then at least one could find resources elsewhere

Can it just find or also replace?
Some users stated here that it cannot replace.

Are there examples of what it can or cannot do?
Again, there is a lot of heresay in the foums which does not really help.

Can we have someone from the Flare team give us a definite answer on how far support for wildcards and regular expressions really goes?
How come nobody knows anything about it?
I am getting the sneaky suspicion Flare does not really support it or the feature has not been looked at in so long nobody remembers how it works. :)

Or is the answer: Use a third-party tool instead.
That would be OK, too, but it kills me that there is a feature in Flare that could be really useful but nobody knows how to use.

Many thanks for any help.
Buck the Tech Writer
===keep thinking===
Love :flare:
Post Reply