Back

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

Forum Replies Created

Viewing 15 posts - 31 through 45 (of 47 total)
  • Author
    Posts
  • in reply to: GREP replace footnote>punctuation with punct>footnote #54593

    Hello,

    With GREP, it is impossible, because footnote marker can't be entered in the Change To box. You can do it with a script.

    I use this one :

    app.findGrepPreferences = null;
    app.changeGrepPreferences = null;
    app.findChangeGrepOptions.includeFootnotes = false;

    var pattern = “[,;.]+~F”;

    app.findGrepPreferences.findWhat = pattern;
    var finds = app.activeDocument.findGrep();
    for (var i = finds.length-1 ; i>=0 ; i–)
    {
    finds[i].characters.item(-1).move(
    LocationOptions.before,
    finds[i].characters.item(0)
    );
    }
    app.findGrepPreferences = null;
    app.changeGrepPreferences = null;

    in reply to: GREP replace footnote>punctuation with punct>footnote #51583

    “It seems to do it fine if  you use Change All

    J'en apprends tous les jours,  but I would like understand why.

    My example with the script is for french typo, for english you had to inverse: ~F[,;.]

    If you used two regex or more, Peter Kahrel's script (chain_grep_queries) is very very useful.

    in reply to: GREP replace footnote>punctuation with punct>footnote #51581

    Hello,

    With GREP, it is impossible, because footnote marker can't be entered in the Change To box. You can do it with a script.

    I use this one :

    app.findGrepPreferences = null;
    app.changeGrepPreferences = null;
    app.findChangeGrepOptions.includeFootnotes = false;

    var pattern = “[,;.]+~F”;

    app.findGrepPreferences.findWhat = pattern;
    var finds = app.activeDocument.findGrep();
    for (var i = finds.length-1 ; i>=0 ; i–)
      {
      finds[i].characters.item(-1).move(
        LocationOptions.before,
        finds[i].characters.item(0)
        );
      }
    app.findGrepPreferences = null;
    app.changeGrepPreferences = null;

    in reply to: Build a biblical reference index with GREP #54005

    Hello

    This is a very good regex, and I am sure I will need it one day (but for french biblical references, sometimes with roman numbers, I Cor., XV, 14-17 ; II Rois, XVIII, 2 [second roman numerals in small caps]).

    For index, without using a character style, I use a Peter Kahrel's JavaScript : Chain_GREP_queries (download here). Using Test mode, “the script collects all instances matched by the Find What expressions in all selected queries and lists these matches in a new document.” To have a look of the result, you can see my blog, indigrep, here.

    After, you can index with another script as IndexBrutal (Marc Autret) or one of P. Kahrel (here).

    Best and thanks

    in reply to: Build a biblical reference index with GREP #50999

    Hello

    This is a very good regex, and I am sure I will need it one day (but for french biblical references, sometimes with roman numbers, I Cor., XV, 14-17 ; II Rois, XVIII, 2 [second roman numerals in small caps]).

    For index, without using a character style, I use a Peter Kahrel's JavaScript : Chain_GREP_queries (download here). Using Test mode, “the script collects all instances matched by the Find What expressions in all selected queries and lists these matches in a new document.” To have a look of the result, you can see my blog, indigrep, here.

    After, you can index with another script as IndexBrutal (Marc Autret) or one of P. Kahrel (here).

    Best and thanks

    in reply to: Repeat +?etc in lookaheads and lookbehinds #53936

    Hello

    Are you sure about the regular expression ? I think it is (?<=w)s(?=w+[[:punct:]]+$)

    In a lookbehind, the string must have the same length, i.e. the same number of characters. You can't use + * or ?

    ex : (?<=figs?)d is impossible (matche a digit preceded by fig or figs)

    There is no limitation in a lookahead.

    in reply to: Repeat +?etc in lookaheads and lookbehinds #50875

    Hello

    Are you sure about the regular expression ? I think it is (?<=\w)(?=\w+[[:punct:]]+$)

    In a lookbehind, the string must have the same length, i.e. the same number of characters. You can't use + * or ?

    ex : (?<=figs?)\d is impossible (matche a digit preceded by fig or figs)

    There is no limitation in a lookahead.

    in reply to: 2 More bits of GREP that are vexxing me #53922

    Hi. I am come back (too late ?)
    Some others regular expressions for examples :

    ^l for any lower case letters at the beginning of a paragraph. I don't know other solutions to uppercase than Casey D and Jongware (perhaps by changing this Peter Kahrel's JavaScript ? https://creativepro.com/con&#8230;..tility.php or using this script : https://indesigning.net/search-&#8230;..hange-case ?

    [[:blank:]]+Z (or z is equal). The posix [[:blank:]], undocumented, finds 13 spaces + Tabulation (InDesign CS4). Only space, Non-Breaking Space and Tab with InDesign CS3 (both with PC, perhaps different with Mac)

    in reply to: 2 More bits of GREP that are vexxing me #50851

    Hi. I am come back (too late ?)
    Some others regular expressions for examples :

    ^ for any lower case letters at the beginning of a paragraph. I don't know other solutions to uppercase than Casey D and Jongware (perhaps by changing this Peter Kahrel's JavaScript ? https://creativepro.com/con&#8230;..tility.php or using this script : https://indesigning.net/search-&#8230;..hange-case ?

    [[:blank:]]+\Z (or \z is equal). The posix [[:blank:]], undocumented, finds 13 spaces + Tabulation (InDesign CS4). Only space, Non-Breaking Space and Tab with InDesign CS3 (both with PC, perhaps different with Mac)

    in reply to: 2 More bits of GREP that are vexxing me #53909

    Hi,

    @Jessereko

    Just one think (I have no time now) : in a lookbehind, the length of the string must be fixed. What is why you can't use + ? *

    I come back

    in reply to: 2 More bits of GREP that are vexxing me #50848

    Hi,

    @Jessereko

    Just one think (I have no time now) : in a lookbehind, the length of the string must be fixed. What is why you can't use + ? *

    I come back

    in reply to: GREP, if it could only go backwards #53894

    Hi,

    The parenthesis, as litteral character, inside a group [ ] or negative group [^ ] doesn't need blackslash. Same think for [ { } + . ? * | ^ $

    @ Jongware : thanks for explanations, it is difficult for me to explain in english.

    In the regex, you can also use [^(]+

    Laurent

    in reply to: GREP, if it could only go backwards #53888

    Hello,

    With you example, this regex works : ([^)]+only)

    It finds (handbag only) and (coat only)

    Laurent

    in reply to: GREP, if it could only go backwards #50837

    Hi,

    The parenthesis, as litteral character, inside a group [ ] or negative group [^ ] doesn't need blackslash. Same think for [ { } + . ? * | ^ $

    @ Jongware : thanks for explanations, it is difficult for me to explain in english.

    In the regex, you can also use [^(]+

    Laurent

    in reply to: GREP, if it could only go backwards #50832

    Hello,

    With you example, this regex works : \([^)]+only\)

    It finds (handbag only) and (coat only)

    Laurent

Viewing 15 posts - 31 through 45 (of 47 total)