<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><font face="Arial" class="">Very thanks.</font><div class=""><font face="Arial" class="">I use VB-Regex-damienpollet.17.mcz<br class=""></font><div class=""><font face="Arial" class="">By the way, i use Nissus Writer Pro when need learn regex.</font></div><div class=""><font face="Arial" class="">The ripping HTML tags expression is '(?:</?[0-9A-Za-z]+.*?>)’ which of course is not possible in Squeak.</font></div><div class=""><font face="Arial" class=""><br class=""></font></div><div class=""><font face="Arial" class=""><br class=""></font></div><div class=""><font face="Arial" class=""><br class=""></font><div><blockquote type="cite" class=""><div class=""><font face="Arial" class="">On Nov 18, 2016, at 11:05, Hans-Martin Mosner <<a href="mailto:hmm@heeg.de" class="">hmm@heeg.de</a>> wrote:</font></div><font face="Arial" class=""><br class="Apple-interchange-newline"></font><div class=""><p style="font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><font face="Arial" class="">I was going to write this:</font></p><blockquote style="font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><p class=""><font face="Arial" class="">The "+" already means "match one or more of the previous", where "previous" in this case is ".", which means "any character".</font></p><p class=""><font face="Arial" class="">The "?" means "match zero or one of the previous", but it cannot be cmobined with "+".</font></p></blockquote><p style="font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><font face="Arial" class="">But then I realized that "+?" is defined in regex syntax as "lazy" matching, i.e. it finds as few of the previous tokens as needed to to make the pattern match (in contrast, standard "+" matches greedily, so it consumes as much as possible while still matching the pattern).</font></p><p style="font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><font face="Arial" class="">However, the Rx framework in Squeak is quite old and does not have these extensions. A pattern that should work would be "<[^>]+>" which matches an opening angle bracket, any characters that are not closing angle brackets, and finally the closing bracket.</font></p><p style="font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><font face="Arial" class="">Be aware though that correctly stripping tags from HTML is not possible (or at least not trivial) with regex. For example, in your pattern, the "." would not match newlines, but tags can extend over multiple lines, so you would not be able to strip out a multiline tag. My pattern apparently works with newlines, too, but there are other cases that it does not handle (for example, see<a class="moz-txt-link-freetext" href="http://stackoverflow.com/questions/94528/is-u003e-greater-than-sign-allowed-inside-an-html-element-attribute-value">http://stackoverflow.com/questions/94528/is-u003e-greater-than-sign-allowed-inside-an-html-element-attribute-value</a>).</font></p><p style="font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><font face="Arial" class="">So unless you know that your input is going to be fairly regular, don't rely on regex to strip tags. Use a proper HTML/SGML/XML parser, they are designed to do it right.</font></p><p style="font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><font face="Arial" class="">Cheers,</font></p><p style="font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" class=""><font face="Arial" class="">Hans-Martin</font></p></div></blockquote></div><br class=""></div></div></body></html>