in reply to Re^2: regexp question
in thread regexp question

Because one can use \d and \s to build larger character classes. A dot already matches everything but a single character.

What's the point of having such a character inside a character class? All you can do is build 4 different character classes: /[.]/, /[.\n]/, /[^.]/, /[^.\n]/. But they can all be written in a simple, different way: /./, /(?s:.)/, /\n/, and /(*FAIL)/

So, once again, what would be the advantage of having dot inside a character class mean the same thing as outside of it?

Replies are listed 'Best First'.
Re^4: regexp question
by Not_a_Number (Prior) on Oct 28, 2011 at 18:03 UTC
    A dot already matches everything but a single character.

    Err... are you sure you meant to say that?

      Yes. Care to point out another character beside a newline that isn't matched by a dot?

        I think we have a problem of misnegation here.

        You said:

        A dot already matches everything but a single character.

        On the other hand, in several places, perldoc says stuff like 'a dot matches any character'.

        (BTW, I've deliberately avoided any mention of the newline character, as it's not relevant to this discussion.)

        So how do you defend your statement 'A dot (..) matches everything but a single character' in the face of the evidence?