Does negative character class match newline

Q

Does negative character class [^a] match newline characters?

How to write a regular expression to capture tags and attributes from this HTML code:

✍: FYIcenter.com

A

A negative character class will match the newline character, if the newline character is not listed in the class. For example, "[^a]" will match the newline character, when with multiple line modifier "m" specified.

Here is the regular expression to capture tags and attributes from HTML codes: It works with multiple line modifier "m" too, because [^>] matches newline characters:

Click the button to test this regular expression here online:

2013-02-02, 0👍, 0💬