Bumped by Community user
    Bumped by Community user
    Bumped by Community user
3 deleted 12 characters in body
source | link

For a number of reasons (one of them my lameness) I get extremely confused when it comes to whitespace and newlines in regexps.

Say for example that I want to search for an equal sign (=) followed by any number of whitespace and newline characters.

At certain points in time I have done the following in the belief that these regexps are equivalent:

"=[\s\n]*"
"=[\s-\n]*"
"=[\s]*"
"=[\s-]*"
"=\s*"
"=\s-*"

They are not.

The emacsEmacs regexp docs just manage to confuse me on this one. :-(

Cheers /Joakim

For a number of reasons (one of them my lameness) I get extremely confused when it comes whitespace and newlines in regexps.

Say for example that I want to search for an equal sign followed by any number of whitespace and newline characters.

At certain points in time I have done the following in the belief that these regexps are equivalent:

"=[\s\n]*"
"=[\s-\n]*"
"=[\s]*"
"=[\s-]*"
"=\s*"
"=\s-*"

They are not.

The emacs regexp docs just manage to confuse me on this one. :-(

Cheers /Joakim

For a number of reasons (one of them my lameness) I get extremely confused when it comes to whitespace and newlines in regexps.

Say for example that I want to search for an equal sign (=) followed by any number of whitespace and newline characters.

At certain points in time I have done the following in the belief that these regexps are equivalent:

"=[\s\n]*"
"=[\s-\n]*"
"=[\s]*"
"=[\s-]*"
"=\s*"
"=\s-*"

They are not.

The Emacs regexp docs just manage to confuse me on this one. :-(

2 added 13 characters in body
source | link

For some reasona number of reasons (one of them my lameness) I get extremely confused when it comes whitespace and newlines in regexps.

Say for example that I want to search for an equal sign followed by any number of whitespace and newline characters.

At certain points in time I have done the following in the belief that these regexps are equivalent:

"=[\s\n]" "=[\s-\n]" "=[\s]" "=[\s-]" "=\s*" "=\s-*"

"=[\s\n]*"
"=[\s-\n]*"
"=[\s]*"
"=[\s-]*"
"=\s*"
"=\s-*"

They are not.

The emacs regexp docs just manage to confuse me on this one. :-(

Cheers /Joakim

For some reason (one of them my lameness) I get extremely confused when it comes whitespace and newlines in regexps.

Say for example that I want to search for an equal sign followed by any number of whitespace and newline characters.

At certain points in time I have done the following in the belief that these regexps are equivalent:

"=[\s\n]" "=[\s-\n]" "=[\s]" "=[\s-]" "=\s*" "=\s-*"

They are not.

The emacs regexp docs just manage to confuse me on this one. :-(

Cheers /Joakim

For a number of reasons (one of them my lameness) I get extremely confused when it comes whitespace and newlines in regexps.

Say for example that I want to search for an equal sign followed by any number of whitespace and newline characters.

At certain points in time I have done the following in the belief that these regexps are equivalent:

"=[\s\n]*"
"=[\s-\n]*"
"=[\s]*"
"=[\s-]*"
"=\s*"
"=\s-*"

They are not.

The emacs regexp docs just manage to confuse me on this one. :-(

Cheers /Joakim

1
source | link

Whitespace and newlines in regexps?

For some reason (one of them my lameness) I get extremely confused when it comes whitespace and newlines in regexps.

Say for example that I want to search for an equal sign followed by any number of whitespace and newline characters.

At certain points in time I have done the following in the belief that these regexps are equivalent:

"=[\s\n]" "=[\s-\n]" "=[\s]" "=[\s-]" "=\s*" "=\s-*"

They are not.

The emacs regexp docs just manage to confuse me on this one. :-(

Cheers /Joakim