unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* regex: \(.*\)\([a-zA-Z]+\)$ - not working as expected
@ 2015-03-25 12:27 AngusC
  2015-03-25 12:50 ` K.P. Huang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: AngusC @ 2015-03-25 12:27 UTC (permalink / raw)
  To: Help-gnu-emacs

I have text like this:

some description here Status1
some other description Status2
some other interesting description Status1

I am using regex like this:

\(.*\)\([a-zA-Z]+\)$

with replacement text:

\1 ZZZ \2

And what I expected was:

some description here ZZZ Status
some other description ZZZ Fault
some other interesting description ZZZ Status

But instead I got:

some description here Statu ZZZ s
some other description Faul ZZZ t
some other interesting description Statu ZZZ s

I want my expected outcome, how do I do that?

What was wrong with my regex?




--
View this message in context: http://emacs.1067599.n5.nabble.com/regex-a-zA-Z-not-working-as-expected-tp353090.html
Sent from the Emacs - Help mailing list archive at Nabble.com.



^ permalink raw reply	[flat|nested] 7+ messages in thread
[parent not found: <mailman.2738.1427286469.31049.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2015-03-25 14:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-25 12:27 regex: \(.*\)\([a-zA-Z]+\)$ - not working as expected AngusC
2015-03-25 12:50 ` K.P. Huang
2015-03-25 12:54 ` Yuri Khan
2015-03-25 14:16   ` AngusC
2015-03-25 12:57 ` tomas
     [not found] <mailman.2738.1427286469.31049.help-gnu-emacs@gnu.org>
2015-03-25 12:43 ` Loris Bennett
2015-03-25 12:45   ` Loris Bennett

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).