22577Re: Remove x number of characters from a line of text
- May 28, 2012Thanks for all the replies, guys!
Can anyone explain (briefly) what is meant by 'greedy' and 'non greedy' parameters, please?
Oh, and I bought RegexBuddy last night. Started playing around with it, but still have a lot to learn, clearly!!
--- In firstname.lastname@example.org, "flo.gehrke" <flo.gehrke@...> wrote:
> --- In email@example.com, "elibrarian22" <kim@> wrote:
> > This one should take care of any number of digits being at the
> > end of a line, after after a space (including the space):
> > \x20\d*?$
> > that is:
> > ? = make the previous expression non-greedy
> The purpose of making a pattern ungreedy is to prevent it from achieving unwanted matches where this could happen. So what are the possibly unwanted matches here if -- between the space and the EOL -- the pattern is aimed at nothing but digits at EOL, and we want to get them all?
- << Previous post in topic Next post in topic >>