hi: s/(?<=^file_)([0-9]+)$/$1+1/e ^^^^^^^^^^ this is looking for the end string with digits. but what (?<=^file_) means? I know "^file_" means the string begins with "file_" but what ?= and ( ) used for? appreciate your help, miloody
2008/7/6 Dr.Ruud <[EMAIL PROTECTED]>: > loody schreef: > >> I try to update the end of my file index by 1 per day. >> ex: >> file_0 --> file_1 >> file_10 --> file_11 > > I think you are looking for something like > > s/(?<=^file_)([0-9]+)$/$1+1/e > > > Example: > > $ echo -e 'file_0\nfile_10' | perl -wpe' > s/(?<=^file_)([0-9]+)$/$1+1/e > ' > file_1 > file_11 > > -- > Affijn, Ruud > > "Gewoon is een tijger." > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > http://learn.perl.org/ > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/