Loading ...
Sorry, an error occurred while loading the content.

Re: [Clip] Re: REQUEST : Uppercase and lowercase in ^!Replace command.

Expand Messages
  • Sheri
    ... Those are posix character classes, they work on the search side only. ^!Find . +[[:lower:]] RS You can do the same thing with a range: ^!Find .
    Message 1 of 5 , Feb 5, 2008
    • 0 Attachment
      leroydennis254 wrote:
      > Thanks, the problem is, I need to do this in a ^!Replace function. (line by line)
      >
      > I found this in the regexp helpfile, but God only knows how to use these :
      >
      > CHARACTER CLASSES
      >
      >
      > [...] positive character class
      > [^...] negative character class
      > [x-y] range (can be used for hex characters)
      > [[:xxx:]] positive POSIX named set
      > [[:^xxx:]] negative POSIX named set
      >
      > alnum alphanumeric
      > alpha alphabetic
      > ascii 0-127
      > blank space or tab
      > cntrl control character
      > digit decimal digit
      > graph printing, excluding space
      > lower lower case letter
      > print printing, including space
      > punct printing, excluding alphanumeric
      > space whitespace
      > upper upper case letter
      > word same as \w
      > xdigit hexadecimal digit
      >
      >
      >
      > I've been trying and trying, but no luck. According to the helpfile, there should be something like [[:upper:]] , but I can't get it doen. :(
      >
      >
      Those are posix character classes, they work on the search side only.

      ^!Find "\. +[[:lower:]]" RS

      You can do the same thing with a range:

      ^!Find "\. +[a-z]" RS

      If you use a \K where you want the match to start, it will require the
      period and one or more spaces, but will select only what follows.

      ^!Find "(?:^ *|\. +)\K[a-z]" RS

      That will find lower case letters at the start of a paragraph after
      optional spaces or after a period followed by one or more spaces.

      Then you can upcase the selection.
      ^!Menu Modify/Text Case/Upper Case
      or
      ^!InsertText ^$StrUpper(^$GetSelection$)$

      Do it in a loop until no more are found.

      :Loop
      ^!Find "(?:^ *|\. +)\K[a-z]" RS
      ^!Iferror Out
      ^!Menu Modify/Text Case/Upper Case
      ^!Goto Loop
      :Out

      If you don't have other miscellaneous proper names or capitalizations in
      the document, you can do this instead. It will modify the entire
      document at once:

      ^!Select All
      ^!Menu Modify/Text Case/Sentence

      Regards,
      Sheri
    Your message has been successfully submitted and would be delivered to recipients shortly.