stringhashtml =: ...

You might try this definition instead:

           stringhashtml =: (rxcomp '(?i)<html>[^\0]*</html>')
                            &(0&<:@:((<0 0)&{)@rxmatch)

Examples:

           stringhashtml 'no html'
        0
           stringhashtml '<html>yes html</html>'
        1
           stringhashtml '<HTML>caps html</HTML>'
        1
           stringhashtml '<HtMl>mixed case html</hTmL>'
        1
           stringhashtml '<html>',({.a.),'uh oh, a null</html>'
        0
           stringhashtml '<html>unclosed html'
        0

I hope this one doesn't crash on you.  Good luck.

-Dan

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to