in reply to Regexpression is not matching

This works for me, making me wonder if there's a typo or variance between spaces and tabs, or somesuch in your problem statement or if the dot at the end of your sample data line is somehow included in your code:

#!/usr/bin/perl use 5.016; # 1037230 my $string = " Code (inc. data) RO Data RW Data ZI Data + Debug Object Name\n"; # no trailing full stop/dot/period if ( $string =~m# Code \(inc\. data\) RO Data RW Data ZI +Data Debug Object Name#) { say "Good to go"; }
That which looks like a space above, is.

If you didn't program your executable by toggling in binary, it wasn't really programming!

Replies are listed 'Best First'.
Re^2: Regexpression is not matching
by tobias_hofer (Friar) on Jun 05, 2013 at 14:49 UTC
    I just have had a look, it was a missing space between ZI Data and Debug. Guess i need new glasses ;-)

    Best regards! Tobias
Re^2: Regexpression is not matching
by gurpreetsingh13 (Scribe) on Jun 06, 2013 at 05:05 UTC
    For me too....
    perl -e 'my $val=" Code (inc. data) RO Data RW Data ZI Da +ta Debug Object Name\n"; print "Yes" if $val =~ m# Code \ +(inc\. data\) RO Data RW Data ZI Data Debug Object Nam +e#;'

    Yes

    Might be some space or chomp issue I belive