[EMAIL PROTECTED] wrote:

ok does this s/^(?=E\d{5})/eject\t0,0,0\t\n/ while <>;
say...

from the beginning of the line match 0 or 1 E's with any digits then print

?=E is sort of odd, I think you mean E? so it is substituting the first part with the second part



s/^E?\d{5}/eject\t0,0,0\t\n/

will take a part of string like E12345 or 12345 and change it to eject\t0,0,0\t\n (only once and with an upper case E)

then you need a print statement to print anything.

while(<>) {
 s/^E?\d{5}/eject\t0,0,0\t\n/;
 print;
}

the eject string? I am not following the { 5 }. my E string is 6 characters long, so why the 5?

\d{5} says five digits

isn't there a insert regular expression?
HTH

Lee.M - JupiterHost.Net

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to