Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

regex - match single character at end of a line

807607Nov 4 2006 — edited Nov 4 2006
I have a list of words, one to each line, and each word has a single character at the end that denotes its part of speech. Therefore, I'm trying to write a regular expression that will match a single character at the end of line, so I can parse through this data.

I can't just use something like [N$] because it will just match the first 'N' from the end of the line, not just lines that end in N. So I want something that will match a single character at the end of a line.

So if my data contained something like:
BounceN
BouncerV

I would want the regular expression to match 'N' at the end of a line to match just "BounceN" and not "BouncerV".

Thanks for you time, and thanks in advance to anyone that can help.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 2 2006
Added on Nov 4 2006
3 comments
333 views