NinGoo/flashstat — Issue #1: Failing regexp on line 255
Author: jostmart
Created: 2012-01-19 08:41:31+00:00
State: open

This is how it look for me, since I have a hardware raid.

ssd dev (/dev/cciss/c0d1), disk dev (/dev/mapper/xyz-usr_local_var_foo) cache mode(WRITE_BACK)

This regexp is better since it matches the first slash, and takes everything it finds, until the first ending parenthesis )

#!/usr/bin/perl
use strict;
my $line = 'ssd dev (/dev/cciss/c0d1), disk dev (/dev/mapper/xyz-usr_local_var_foo) cache mode(WRITE_BACK)';

$line =~ m/(\/[^\s]*)\).*(\/[^\s]*)\)/;
print $1 . "\n";
print $2 . "\n";

exit 0;