Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

FindChangeByList: grep \d trouble

Return to Member Forum

  • Author
    Posts
    • #104288

      Hello,

      I have some really strange problem with FindChange.
      I have read and experimented quite some time and I can’t find what’s wrong.

      What I need to do:
      Create grep replacements for any number – any dash, with spaces or not – any number //changeTo// same number – m-dash – same number.

      This is my code:
      grep {findWhat:”(\d)-(\d)”} {changeTo:”$1~_$2″} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
      grep {findWhat:”(\d)~=(\d)”} {changeTo:”$1~_$2″} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
      grep {findWhat:”(\d)~-(\d)”} {changeTo:”$1~_$2″} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
      grep {findWhat:”(\d)~=(\d)”} {changeTo:”$1~_$2″} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
      grep {findWhat:”(\d)~-“} {changeTo:”$1~s^_”} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
      grep {findWhat:”(\d)~=”} {changeTo:”$1~s^_”} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
      grep {findWhat:”(\d)~_”} {changeTo:”$1~s^_”} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}

      The result:
      Any of these are not working via FindChangeByList, but the funny thing is, they do work in normal grep search and replace.
      Furthermore, I have discovered that even the simplest {findWhat:”\d”} doesn’t work in my case.
      I’m starting to think there is some out-of-the-box reason, like encoding problems (some of my grep searches are in cyrillic).

      My request:
      Do you have any idea how to make this work?
      Do you see how can I optimize my search?

      A possible solution is to use grep queries and find some tool to chain them, but FindChangeByList already serves my needs very well, except for this issue with numbers.

    • #104290
      Aaron Troia
      Participant

      Hey Radomir,

      The FindChangeByList script is … special. Have you tried double escaping? so instead of \d you would do d. Its been awhile since I’ve played with that script but I feel I had to double escape metachracters and punctuation marks to get them to work.

    • #104292

      Thank you, Aaron!

      Yep, I remember I read something about d and I tried, but it didn’t help.
      I should try on another machine maybe…

Viewing 2 reply threads
  • You must be logged in to reply to this topic.
Forum Ads