Skip to main content
dauphinb
Inspiring
September 18, 2020
Question

Can I Create a Library of Regex Searches?

  • September 18, 2020
  • 3 replies
  • 1069 views

I'm playing around with regular expressions (for the first time; yes, I'm late to the game) in FM2019, and I'd like to create a library of commonly useful regex search/replace strings for my colleagues to use. To make it convenient, I'd thought of putting a selection of these items on a reference page in our basic chapter template, so it would always be just View>Reference Pages away, or perhaps including a separate regex list as part of our book template... but I'd like to make it even more accessible: Is there any way to make saved searches accessible directly in the Find/Change dialogue?

 

I know Find/Change saves a history of recent strings as a drop-down list in both the Find and Change fields; is there any way to "seed" those lists with predetermined strings (or some other way I haven't thought of to save searches)?

 

This is a nice-to-have, rather than urgent, need... but it sure would be nice to have. Any insights would be, by me, greatly appreciated!

    This topic has been closed for replies.

    3 replies

    Barb Binder
    Community Expert
    Community Expert
    September 22, 2020

    Voted! (And thank you, DauphinB.)

     

    ~Barb 

    ~Barb at Rocky Mountain Training
    Barb Binder
    Community Expert
    Community Expert
    September 21, 2020

    Hi DauphinB:

     

    Is there any way to make saved searches accessible directly in the Find/Change dialogue?

    This is a such a sensitive subject for me, and I've tried communicating to this to the FrameMaker team—both in person as well as through Tracker (case was closed but the issue was not addressed: https://tracker.adobe.com/#/view/FRMAKER-3589). 

     

    InDesign (Adobe's other page layout application) allows you to create and save as many custom REGEX queries as you like (called GREP in InDesign, but it's the same feature), and they are available in the Query dropdown menu in Find/Change.

     

    In addition, InDesign has a REGEX menu that you can use to quickly develop basic queries—great for a new user who is just getting up and running.

     

    As you will see in the Tracker link, Stefan (EDIT: seems to) thinks that having the last 10 queries visible in the recent query is sufficient. I disagree because it may take me a few tries to fine tune the REGEX and by the time I do, a few of my working queries have dropped off the bottom of the list. Also, after a crash, the list will disappear entirely. Finally, InDesign saves both the Find and Change fields in a saved query—in Fm, if a recent query is still in both lists, you have to manually match them up. 

     

    My workflow: I work through a new query in InDesign, and then save working queries in Word and copy paste the ones that drop off back into FrameMaker. It's a silly workflow, and one that can be addressed with an update to a future version on FrameMaker. 

     

    Please consider logging a new feature request on Tracker: https://tracker.adobe.com/#/home and posting a link to it here. I will certainly vote for it. 

     

    ~Barb 

    ~Barb at Rocky Mountain Training
    K.Daube
    Community Expert
    Community Expert
    September 22, 2020

    Barb, the support of Regex in ID is overwhelming!

    I for my part use RegexBuddy to develop regular expressions. A great disadvantage in FM are the very limited expressions in the replacement.

    And yes, I also have a sidekick document with the regexes I need often, from which I copy and paste into FM...

    Klaus

    K.Daube
    Community Expert
    Community Expert
    September 22, 2020

    Spinning this a little bit further ...

    To avoid to much programming (repeat all the functions of the Find/Replace dialgoue) i can imagine controlling the F/R dialogue from outside of FM by an AutoHotkey script sending keystrokes.  I had developed an application with this method some time ago.

    The UI could look like this:

    My intended work flow is this:

    Save a set of settings

    1. User develops find/replace pair (with all options) in FM Find/Replace dialogue
    2. If satisfied, the settings are read by the script Get settings from FM
    3. The fields in the ahk panel are filled by the settings to see what has been gotten. Th Combo-box next to Save As will become empty.
    4. User may now enter a name for the the settings use button Save As.

    Use a set of settings

    1. User searches for the required settings by name in the Combo-box.
    2. With Use in FM the FM Fin/Replace dialogue is opened and the settings are transferred to it.
    3. User continues in the FM dialogue.
    K.Daube
    Community Expert
    Community Expert
    September 18, 2020

    You may have a look into the maker.ini file in %appdata%\Adobe\FrameMaker\15 (or 16) directory. The list of used find/replace strings however can not be long. The limit seems to be 8 or something like that.