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

474Re: [jasspa] How to do regexp search and search+replace on a string?

Expand Messages
  • Jon Green
    Nov 12, 2001
    • 0 Attachment
      Thomas Hundt wrote:

      > Anybody have a suggestion for how to do the 'replace-string'
      > functionality on a string?
      >
      > One way would be to create a scratch buffer, paste the string into
      > there, do replace-string on it, cut the string back out of the
      > buffer. That seems really awkward.
      >
      > An even more awkward way would be to just call Perl to do it. :-)
      > I've been using that lately and have gotten spoiled by the regexp
      > capability always being available.
      >
      > The &sin and related functions do not use regular expressions -- but
      > I think it would be cool if they did :-). Are there other functions
      > that I don't know about? :-)
      >
      > Thanks
      >
      > -Tom Hundt


      I think you have outlined all of the methods here. And no there
      are no more - calling Perl is probably going a little too far !!
      Dropping it into a temporary buffer and then doing the work
      in the buffer is probably the best way. You can use the @s0..9
      variables to get the search string results back.

      However, I think I agree with you - it would be real nice to
      be able to use regexp on a string in line with all of the power
      of some of the interpreted langauges.

      Regards
      Jon.


      >
      >
      >
      > __________________________________________________________________________
      >
      >
      >
      > This is an unmoderated list. JASSPA is not responsible for the content of
      >
      > any material posted to this list.
      >
      >
      >
      >
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
      >
      >
      >
      >
    • Show all 2 messages in this topic