On Tue, Jan 4, 2011 at 11:07 AM, Richard D. Moores <rdmoo...@gmail.com> wrote: > A file has these 2 lines: > > alksdhjf ksjhdf kjshf dex akjdhf jkdshf jsdhf > alkdshf jkashd flkjdsf index alkdjshf alkdjshf > > And I want the only line that contains the word "dex"
Ah! Then you want a slightly different Regex pattern. .*dex.* would match both lines. You'll need to be more specific when you say "the word dex" to determine your regex. \sdex\s will match dex surrounded by whitespace, which might be what you want. \bdex\b will match dex surrounded by word boundaries, which is probably the best pick. -- Brett Ritter / SwiftOne US2003011110 swift...@swiftone.org _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor