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

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

SOLVED - Re: Strange whitespace remains after emoji regexp replace


From: Jean Louis
Subject: SOLVED - Re: Strange whitespace remains after emoji regexp replace
Date: Wed, 25 Dec 2024 16:44:25 +0300
User-agent: Mutt/2.2.12 (2023-09-09)

* Eli Zaretskii <eliz@gnu.org> [2024-12-25 15:53]:
> > The difference to normal space is that it has some ️ (#xfe0f)
> > VARIATION SELECTOR-16
> > 
> > But I don't want it. I want to clean EVERYTHING what is not
> > alpha-numeric from the string.
> > 
> > How do I make sure of it?
> 
> Remove the VS-16 character as well, how else?

For you natural, for me mystery, though thanks 🙏👍💬, I got it now
after all.

I have found the answer online, that it is special character 📝 \uFE0F 
and without online assistance, I would never find it. 💻

(defun wrs-search-clean-entry (entry)
  "Clean and normalize a ENTRY string.

Prepare it for easier searching"
  (let* ((entry (replace-regexp-in-string (rx (one-or-more (or (not alnum) "\n" 
blank))) " " entry))
         (entry (replace-regexp-in-string "[\u200B-\u200D\uFEFF\uFE0F]" " " 
entry))
         (entry (replace-regexp-in-string (rx (one-or-more " ")) " " entry))
         (entry (string-trim entry)))
    entry))

It is \uFE0F

Problem solved for now! 🙌

Thanks much! 😊

Jean Louis



reply via email to

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