[Top][All Lists]

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

regex: \(.*\)\([a-zA-Z]+\)$ - not working as expected

From: AngusC
Subject: regex: \(.*\)\([a-zA-Z]+\)$ - not working as expected
Date: Wed, 25 Mar 2015 05:27:08 -0700 (MST)

I have text like this:

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

I am using regex like this:


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:
Sent from the Emacs - Help mailing list archive at

reply via email to

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