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

RE: [PBML] Lil help?

Expand Messages
  • Jason Larson
    ... From a post from a day or two ago... ... (Reply is from Japhy) ... s/(.{1,70}) s/$1 n/g; That says match between 1 and 70 characters (as many possible)
    Message 1 of 7 , Mar 8, 2002
      > -----Original Message-----
      > From: dmcdougald@... [mailto:dmcdougald@...]
      > Subject: [PBML] Lil help?
      > Im working on a CGI and I have a problem with TEXTAREA.
      > Even if I use Hard breaks, the array spits out as a single
      > line, and the
      > max width of the application Im using it for is 26 lines at 70
      > characters per line.
      > How do I evaluate an array, print out its contents, if its
      > length > 70
      > then insert a linebreak, if 70 chrs is midword, go to
      > beginning of that
      > word and insert line break?
      > Darrin

      From a post from a day or two ago...
      (Reply is from Japhy)
      On Mar 6, M z said:

      >I've written a little program to analyze lines that
      >are longer than 70 characters, and if so, break at
      >position 70 (if it is whitespace), if not whitespace
      >(i.e. is in the middle of a word) it steps back to the
      >first whitespace and breaks there.


      That says "match between 1 and 70 characters (as many possible) and then a
      piece of whitespace" and replace it with the same text, except convert the
      whitespace into a newline. And the /g modifier says "do it for all

      Hope this helps...



      The information contained in this ELECTRONIC MAIL transmission
      is confidential. It may also be privileged work product or proprietary
      information. This information is intended for the exclusive use of the
      addressee(s). If you are not the intended recipient, you are hereby
      notified that any use, disclosure, dissemination, distribution [other
      than to the addressee(s)], copying or taking of any action because
      of this information is strictly prohibited.


      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.