Ahh, the magic parenthesis...<br> Thanks Joshua.<br><b><i>Joshua McAdams &lt;joshua.mcadams@gmail.com&gt;</i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> &gt; &gt; I have a little script that finds the line which<br>&gt; &gt; contains a six digit number begining with 1 or<br>&gt; &gt; greater.  I know that $_ represents the line,<br>&gt; &gt; however, I am having trouble figuring out how to<br>&gt; &gt; save that number once it's found (without everything<br>&gt; &gt; else in the line).<br>&gt; &gt;<br>&gt; &gt;  #!/usr/bin/perl -w<br>&gt; &gt;<br>&gt; &gt;  @ARGV = "/home/richard/test/out.txt";<br>&gt; &gt;  while (&lt;&gt;) {<br>&gt; &gt;      if ( /\b[123456789][0-9][0-9][0-9][0-9][0-9]\b/<br>&gt; &gt; ) {<br>&gt; &gt;          print "Found\n" . $_ . "\n";<br>&gt; &gt;      }<br>&gt; &gt;  }<br>&gt; &gt;<br><br>Put some parenthesis around the expression...<br><br>if (
 /\b([123456789][0-9][0-9][0-9][0-9][0-9])\b/ ) {<br>    print "Found\n" . $1 . "\n";<br>}<br><br>I think that you could tighten up the expression a little too...<br><br>if ( /\b([1-9]\d{5})\b/ ) {<br>    print "Found\n" . $1 . "\n";<br>}<br>_______________________________________________<br>Chicago-talk mailing list<br>Chicago-talk@pm.org<br>http://mail.pm.org/mailman/listinfo/chicago-talk<br></blockquote><br><BR><BR>A people that values its privileges above its principles soon loses both.<br> -Dwight D. Eisenhower.