gnu.emacs.help
[Top] [All Lists]

Re: force upper case of matched regex text pattern

Subject: Re: force upper case of matched regex text pattern
From: Xah
Date: Thu, 13 Mar 2008 04:03:54 -0700 PDT
Newsgroups: gnu.emacs.help

Xah wrote:
 (buffer-substring (match-beginning 1) (match-end 1))

Andreas RÃhler wrote:
 (match-string 1)

Thanks. That's much simpler.

  Xah
  xah@xxxxxxxxxx
â http://xahlee.org/

â


On Mar 13, 1:53 am, Andreas RÃhler <andreas.roeh...@xxxxxxxxx> wrote:
> Am Donnerstag, 13. MÃrz 2008 04:12 schrieb xah...@xxxxxxxxx:
>
> > (defun upcase-matched ()
> >   "Returns the upcase of matched text."
> >   (let (m1 returnText)
> >     (setq m1 (upcase (buffer-substring (match-beginning 1) (match-end
> > 1))))
> >     (setq returnText (concat "<p>" m1 ))
> >     returnText
> >   )
> > )
>
> Maybe I miss your point:
>
> you should be able to write something like
>
> (concat "<p>" (upcase obj))
>
> where obj is `match-string'
>
> Andreas RÃhler


<Prev in Thread] Current Thread [Next in Thread>