Back

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

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: GREP to insert a full stop at the end of paragraphs #82263
    Mats Leidoe
    Member

    P.S. You can’t use the inside the brackets, even though it is very tempting, since means “any white space”, which apparently includes not only all kinds of spaces and tabs, but paragraph breaks and line breaks as well.

    in reply to: GREP to insert a full stop at the end of paragraphs #82261
    Mats Leidoe
    Member

    Tried this a few times back and forth, but find it hard to make the Regex find only sentences without full stops. One commonly recommended method is using (?!) to match negative lookbehind, since regex doesn’t use “not” (there is only “or”, where you use the pipe |). But using negative lookbehind on full stops only yields strange results in InDesign, or maybe I just don’t master it. So, what’s left? Well, I would use brackets.
    search for:
    ^\u[\u\d\ -,]+$
    replace with:
    $0.
    works for me. It will match
    ^:from the beginning of the line
    \u:one upper case character (as this was meant to match sentences, not just single words, like short captions, I prefer having that \u up front)
    [\u\d\ -,]:any upper case, lower case, digit, space, comma or dash
    +: repeatedly until
    $: the end of the line (but not including the paragraph break, which is a good point, and it means we can ditch the parenthesises, thanks Peter Kahrel)
    If you need to match other characters, like exclamation mark, add them (with a backslash before if necessary) inside the bracket.

Viewing 2 posts - 1 through 2 (of 2 total)