From: tomas@tuxteam.de
To: uzibalqa <uzibalqa@proton.me>
Cc: help-gnu-emacs@gnu.org
Subject: Re: [External] : At least one character at beginning and end of words
Date: Mon, 15 Aug 2022 11:48:36 +0200 [thread overview]
Message-ID: <YvoWdNeIYYqdcg4X@tuxteam.de> (raw)
In-Reply-To: <m9HKwXGcvNlU4Jbd0eko_WyxUQaTua_K0p2sAl7kXM7xwgMAqB5DxH95ml59GXzlyKCT14vDgZ292VOMU9mQ_pYhhTeTTgHyngHWE1SVcRw=@proton.me>
[-- Attachment #1: Type: text/plain, Size: 1146 bytes --]
On Mon, Aug 15, 2022 at 09:25:50AM +0000, uzibalqa wrote:
> ------ Original Message -------
> On Monday, August 15th, 2022 at 4:36 AM, <tomas@tuxteam.de> wrote:
>
>
> > On Sun, Aug 14, 2022 at 11:43:10PM +0000, Drew Adams wrote:
> >
> > > > I want to match the sequence "at least one letter" then "ple"
> > > > then "at least one letter". How would a regexp look like.?
> > >
> > > "[:alpha:]+ple[:alpha:]+"
> > >
> > > I think you should spend some time reading the Elisp manual section on regexps.
>
> Although I have done
>
> (insert (replace-regexp-in-string
> "\\([:alpha:]+\\)ple\\([:alpha:]+\\)" "\\1p\\2" word))
>
> word is being left intact.
It's all in the manual, which you consistently ignore. Please do have
a look at it.
The [: ... :] character classes only go into the character class brackets
(i.e. [ ... ]). So you need two pairs of brackets, like so: [[:alpha:]].
Yes, it looks strange. But it starts making sense when you want to combine
things (e.g. alpha plus comma or dash: [[:alpha:],-])
Please, look into the manual. It takes some effort, but it's worth it.
Cheers
--
t
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2022-08-15 9:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-14 21:08 At least one character at beginning and end of words uzibalqa via Users list for the GNU Emacs text editor
2022-08-14 23:43 ` [External] : " Drew Adams
2022-08-15 4:36 ` tomas
2022-08-15 9:25 ` uzibalqa
2022-08-15 9:48 ` tomas [this message]
2022-08-15 10:26 ` uzibalqa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YvoWdNeIYYqdcg4X@tuxteam.de \
--to=tomas@tuxteam.de \
--cc=help-gnu-emacs@gnu.org \
--cc=uzibalqa@proton.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).