in reply to Regex capture between word and punctuation

Why, O Why, does this look like a homework assignment? Never mind.

Hint 1: The regex you would be looking for is something like this: /\bit\b.*[,.?]$/i

Hint 2: use a regex to strip off everything before the first (last?) "it" and print the remainder of the line.

Note that hints are not complete solutions.

Also, your title is not sufficiently descriptive of the problem you are looking for assistance on.


emc

Information about American English usage here and here. Floating point issues? Please read this before posting.

  • Comment on Re: Regex capture between word and punctuation

Replies are listed 'Best First'.
Re^2: Regex capture between word and punctuation
by negzero7 (Sexton) on Mar 18, 2008 at 17:06 UTC
    Thank you for the help. This isn't homework, I'm out of college, but this is from a book. And I'm not looking for a complete solution, just some help with my regular expression (and apparently a loop I missing :D). Please don't think I want hand holding, just a point in the right direction so to speak. Or someone to say I did/doing something wrong. I apologize for my crappy thread title, I'll be more descriptive in the future. Thanks for the fast responses!