Hi Monks, I put this out earlier, but how would you gather a job name as shown below that is not called 'New Job'? Basically, I want to capture any type of name that I give a job i.e. Testing01, mymusic, myimages2 etc. Could I use a character class here? As always, thanks for your time and I welcome your wisdom.
use strict; use warnings; use Data::Dumper; $Data::Dumper::Indent = 1; my ($job); while(<DATA>){ chomp; next unless /Synchronizing started|Synchronizing finished|Summary/; my $summary; $summary++ if /Summary/; my $this_job; if (($this_job) = $_ =~ /"New Job (\d+)"$/){ $job = $this_job; } print qq{job: $job } if $summary; print qq{$_\n}; }; __DATA__ [4/14/2008 4:44 PM] Analyzing started, job: "New Job 1" [4/14/2008 4:45 PM] Synchronizing started, job: "New Job 1" [4/14/2008 4:45 PM] Analyzing finished, job: "New Job 1" [4/14/2008 4:45 PM] Synchronizing finished, job: "New Job 1" [4/14/2008 4:45 PM] Summary: Files processed: 6,554; Files copied: 1;
In reply to Regex Character Class? by raj8
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |