Hi,
Regarding Find/Replace, does the Replace function support regular expression backreferences for groups that are part of the Find expression?
I tried the following tokens but none worked (it treated the characters as literal):
\1
\\1
$1
Am I using the wrong syntax or this not possible in Flare? (I know this can be done using utilities such as FAR HTML tools, but would prefer to do it in Flare if possible.)
Thanks,
Adrian
Regular expression support in Replace function
-
RiverMonster
- Sr. Propeller Head
- Posts: 149
- Joined: Fri May 09, 2008 8:51 am
- Location: Alicante, Spain
- Contact:
-
KevinDAmery
- Propellus Maximus
- Posts: 1985
- Joined: Tue Jan 23, 2007 8:18 am
- Location: Darn, I knew I was around here somewhere...
Re: Regular expression support in Replace function
I'm not an expert in regular expressions, but there is an option to use them. At the bottom of the Find and Replace window there is an option called "Use". If you turn it on, you can change the search from using Wildcards to Regular Expressions.
I'm not competent to tell you if your syntax is correct though....
I'm not competent to tell you if your syntax is correct though....
Until next time....

Kevin Amery
Certified MAD for Flare
Kevin Amery
Certified MAD for Flare
-
RiverMonster
- Sr. Propeller Head
- Posts: 149
- Joined: Fri May 09, 2008 8:51 am
- Location: Alicante, Spain
- Contact:
Re: Regular expression support in Replace function
Thanks Kevin,
I have this option turned on. I am able to use Regular Expressions in the Find control, but not in the Replace field. From what I understand, a fully implemented regular expression engine should allow one to enter "placeholders" in the Replace field that swap in the text found by any specied "group" in the search expression (a group merely being any part of the expression that is surrounded by standard parentheses). I am not sure if I am using the wrong syntax for those placeholders or this functionality is just not implemented in Flare (i.e. you can find using Reg Ex but only replace with literal text).
Thanks,
Adrian
I have this option turned on. I am able to use Regular Expressions in the Find control, but not in the Replace field. From what I understand, a fully implemented regular expression engine should allow one to enter "placeholders" in the Replace field that swap in the text found by any specied "group" in the search expression (a group merely being any part of the expression that is surrounded by standard parentheses). I am not sure if I am using the wrong syntax for those placeholders or this functionality is just not implemented in Flare (i.e. you can find using Reg Ex but only replace with literal text).
Thanks,
Adrian
Re: Regular expression support in Replace function
I think we would do well to get more documentation on what the characters supported for regular expression in Flare's Find/Replace field.
At the moment all i know are the asterix '*' character.
https://www.madcapsoftware.com/bugs/sub ... lare&v=4.2
I think there's a blog post about Flare's regular expressions somewhere. but if i am right it Flare's find/replace doesn't support that backtracking facility of regular expressions...
At the moment all i know are the asterix '*' character.
https://www.madcapsoftware.com/bugs/sub ... lare&v=4.2
I think there's a blog post about Flare's regular expressions somewhere. but if i am right it Flare's find/replace doesn't support that backtracking facility of regular expressions...
If you submit your bug feedback request here, the more likely it'll get fixed or included in a future release
Open Utilities PageLayout Resizer for Flare/Blaze | Batch builder
Open Utilities PageLayout Resizer for Flare/Blaze | Batch builder
Re: Regular expression support in Replace function
It seems Flare doesn't support backreferences which are key for this task. It's a small but critical missing piece of functionality. I encourage everyone to submit a bug request at the usual place: http://www.madcapsoftware.com/bugs/submit.aspx
-
rob hollinger
- Propellus Maximus
- Posts: 661
- Joined: Mon Mar 17, 2008 8:40 am
Re: Regular expression support in Replace function
Back Reference support has been added in Flare V10.
Here is an example Find and Replace using Regular Expressions to find a specific style and replace it with a different style while maintaining the content between the tags.
Regular Expression to find all <p class=â€moreâ€> tags and its closing tags </p>
<p class="more">((.?\s?)*?)</p>
Replace with h3 tags and putting the content between the tags back
<h3>\1</h3>
\1 is the back reference for the content between the tags.
Example:
This:
<h1>Heading Three Auto Bravo2</h1>
<p class="more">Delete this text and replace it with your own content.</p>
<p> </p>
Becomes This:
<h1>Heading Three Auto Bravo2</h1>
<h3>Delete this text and replace it with your own content.</h3>
<p> </p>
Here is an example Find and Replace using Regular Expressions to find a specific style and replace it with a different style while maintaining the content between the tags.
Regular Expression to find all <p class=â€moreâ€> tags and its closing tags </p>
<p class="more">((.?\s?)*?)</p>
Replace with h3 tags and putting the content between the tags back
<h3>\1</h3>
\1 is the back reference for the content between the tags.
Example:
This:
<h1>Heading Three Auto Bravo2</h1>
<p class="more">Delete this text and replace it with your own content.</p>
<p> </p>
Becomes This:
<h1>Heading Three Auto Bravo2</h1>
<h3>Delete this text and replace it with your own content.</h3>
<p> </p>
You do not have the required permissions to view the files attached to this post.
Rob Hollinger
MadCap Software
MadCap Software
-
BaritoneJP
- Propeller Head
- Posts: 49
- Joined: Mon Jun 02, 2008 9:12 am
- Contact:
Re: Regular expression support in Replace function
A site that I use to help me build (reference) and test RegEx expressions is http://www.regexr.com/
This site also has examples in the community section that will also give you a lot of good references. However, a good tip in using this site and building expressions ... "if at first you don't succeed, try, try again."
This site also has examples in the community section that will also give you a lot of good references. However, a good tip in using this site and building expressions ... "if at first you don't succeed, try, try again."
Thank you for your comments and help with my quandary ...
Jamey
Jamey
-
ChoccieMuffin
- Senior Propellus Maximus
- Posts: 2650
- Joined: Wed Apr 14, 2010 8:01 am
- Location: Surrey, UK
Re: Regular expression support in Replace function
NEED a Like button for that post, Rob!
Started as a newbie with Flare 6.1, now using Flare 2024r2.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
-
RiverMonster
- Sr. Propeller Head
- Posts: 149
- Joined: Fri May 09, 2008 8:51 am
- Location: Alicante, Spain
- Contact:
Re: Regular expression support in Replace function
A very useful feature!
Re: Regular expression support in Replace function
Me likes Rob, too 