help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: query-replace-regexp on a string with '=' sign


From: Emanuel Berg
Subject: Re: query-replace-regexp on a string with '=' sign
Date: Thu, 08 Sep 2022 11:53:44 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Pankaj Jangid wrote:

> I have a line like this,
>
> HELLO=WORLD
>
> now I want to downcase the part before the equal (=) sign.

(while (re-search-forward "\\(.+\\)\\(=\\)" nil t)
  (replace-match
   (concat (downcase (match-string-no-properties 1))
           (match-string-no-properties 2) ) t))
;; We=
;; Are=
;; Robots=

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]