filename regex?

J

Jules

Am trying to modify a regular expression in a perl script at:
http://groups.google.com/[email protected]
the regex in this line:
if (my ($ft) = $_ =~ m|^(\d+)\.\d+\.|) {
has to match the file name of your mail files. I use mail files named like
so:

1049831444.88767.thunderbird.etv.net,S=2514

timestamp.procId.domainname,S=filesize

My mail files are named slightly different, for example:
1075497569.85543_0.host.domain.net

timestamp.procId_0.domainname

Can anyone help modify the regex to match my filename?
 
W

Walter Roberson

|http://groups.google.com/[email protected]

|> the regex in this line:
|> if (my ($ft) = $_ =~ m|^(\d+)\.\d+\.|) {
|> has to match the file name of your mail files. I use mail files named like
|> so:

|> 1049831444.88767.thunderbird.etv.net,S=2514

|My mail files are named slightly different, for example:
|1075497569.85543_0.host.domain.net

|Can anyone help modify the regex to match my filename?

m|^(\d+)\.\d+_0\.|

would be the closest equivilent.
 
M

MPBroida

Jules said:
Am trying to modify a regular expression in a perl script at:
http://groups.google.com/[email protected]


My mail files are named slightly different, for example:
1075497569.85543_0.host.domain.net

timestamp.procId_0.domainname

Can anyone help modify the regex to match my filename?

m|^(\d+)\.\d+_0\.|

might work. All I did was add the _0 after the
last set of digits. If that's not always a ZERO,
change _0 to _\d or use \d+ if it might be more
than one digit after the underscore. NOTE: This
REQUIRES the underscore to be present!

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top