The 5 cm example had a line break between the 5 and the cm when I read the page in my phone. A joke?
Preventing line breaks in elements
21–23 of 23 posts
Re: Preventing line breaks in <code> elements
#22You can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML.
You can absolutely parse HTML with regex, so long as the document is finite in length. Every finite language is regular, hence can be parsed with regex's.
and you write your regex specifically for that document length, handling all possible nesting combinations. combinatoric explosion
Re: Preventing line breaks in <code> elements
#23You can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML.
What do you mean you can't. I do it all the time
As the saying goes: you can fool all people some of the time, and some people all of the time.
Actually, depending on what you're doing, it can be totally fine. Just be aware that you're losing some generality.