in reply to regex needed
Either way, suitable use of \s* would suffice, such that the snippet might become...
while (<DATA>) { chomp; next if /^>\s*/; print "MATCH => $_\n"; } __DATA__ >Sensor30 >FooSensor30 > Sensor30 Sensor300 Sensor30 >Sensor3
Note that inverting the sense of the makes the test for whitespace redundant since the next will be executed whenever the line begins with a '>'. To avoid any line whose first non-whitespace char, change /^>\s*/ to /^\s*>/.
|
|---|