in reply to Re^2: reading file
in thread reading file

So you need to read the contents of the file into a scalar variable and match the text with possibly multiple white space or litteral "\n" between any of the characters (hint: \s matches any whitespace including newline).

That should be a clear enough spec, give it a go and get back if you still have an issue.

Replies are listed 'Best First'.
Re^4: reading file
by saranperl (Initiate) on Aug 04, 2009 at 10:34 UTC
    no i applied \s but i wont get the result. I think \s works one for string. it is file, so it reading line by line. so that it not count. my suggestion is we should change way reading the file , Then we can get exact result
      Hi saranperl,

      You applied \s??
      \s is a character class and you need to optionally match it or a literal "\n" between each character it has no effect on the nature of the data you are comparing it to.

      You are however correct to say that you need to change the way you read the data in from the file, or at least the way it is represented when comparing to the regular expression

      (hint 2:Look up the input record separator and see what can be done by redefining it (this is sometimes refereed to as slurping a file)

A reply falls below the community's threshold of quality. You may see it by logging in.