in reply to Re^2: Using grep on windows
in thread Using grep on windows

Is "CNR12345" at the very start of a line? That's what my regex pattern checks for.

Replies are listed 'Best First'.
Re^4: Using grep on windows
by rogermills (Initiate) on Oct 27, 2009 at 21:05 UTC
    yes.. but it will reject all commits even if it has a CNR Log mesasge is like this CNR12345 Whatever message
Re^4: Using grep on windows
by rogermills (Initiate) on Oct 27, 2009 at 21:10 UTC
    yes it is at the start of the comment. But it doesn't work even if u put log message manually. Here is the comment in the log message "CNR12345 commit to hook check"
      You are mistaken.
      my $commitlog = "CNR12345 commit to hook check"; my ($cnr_number) = $commitlog =~ /^(CNR[0-9]+)/m or die("You must enter a valid CNR\n"); print("CNR number is $cnr_number\n");
      $ perl a.pl CNR number is CNR12345