- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
At my school there were two branches -- the CS degree program in the Mathematics department, and the MIS degree in the Business department. The Business department has no business teaching computers or programming IMHO.
Admin
Actually, in most scripting languages (Perl, Python, PHP, Javascript) the regex of this class of complexity is equivalent to about 8 conditionals.
The right regex would be /<br[^>]*?>/gi and in case of many occurences of it in the string, in most script languages it would be universally faster than iterating through all the occurences using a loop.
Admin
<br it's cold> would be still treated as '
' with unknown parameters by the browsers.
would too. Mostly anything is survivable between the < and >. One thing that could break the thing would be:
<br <!-- style="clear:both" --> /> and that's illegal syntax, but we're talking HTML here, so there's no such thing as illegal HTML syntax in the real world.
Admin
oh, and another.
Admin
Oh, the confusion. Any program offering a 4-year degree in computer science should certainly be teaching that there is a theoretical construct known as a "regular expression", that one can be written to match any regular language, that there is an algorithm for producing one from a finite automaton, etc. A degree program will probably not teach you that there is a language feature found in perl and elsewhere that allows you to test whether or not a certain string matches a certain regular expression written in a more complicated language than the formal one described above.
Admin
Y'know, technically in HTML
should become
>.