|
 |
Chambers wrote:
> Hey all, I know it's been a while since I've posted here, but I also know there
> are some regex wizards who read these groups...
>
> I never bothered learning regular expressions, but we're going over them for one
> of my classes, and I'm having trouble searching for strings at the end of a line
> with $.
>
> As I understand it, $ matches for the end of the line. Fine. When I search
> just for $, I get every line (as I should).
>
> However, when I try to append $ onto any other expression, I don't get a single
> match - not one - when I know there should be some. For instance, the
> following:
> ing[.]$
>
> Should search for any line ending in "ing." Searching just for "ing[.]" returns
> the hits I want (plus a few more), but "ing[.]$" doesn't return a single hit.
>
> Any tips as to what I'm doing wrong?
>
Pattern "ing[.]$" matches exactly as you expected,
when applied to the text with Unix-style line endings (\n),
but for Win-style line endings (\r\n) it
doesn't match your input.
Post a reply to this message
|
 |