PicoMite regex challenge

Can anybody help me with the following regex for INSTR() in PicoMite?

The regex is simple in pretty much any other implementation I try, including regexr.com

“\bend +sub\b” should match for lines that have “end sub” in them, with an arbitrary number (1+) of spaces between. But I cannot get this to work on the PicoCalc"

?instr(1," end  sub ","\bend \+sub\b")

This returns 0, but should return 2 to my understanding.
\b begin word boundary
end
\+ (space first) one or more spaces
sub
\b end word boundary

Check the manual - page 174 and Appendix E, You have to include a “size” parameter to tell instr that it is a regular expression.

The size parameter is a floating point variable that is used by the firmware to return the size of a
matching string.

?instr(1," end  sub ","\bend \+sub\b", sizevariable)
1 Like
1 Like

Oof. Thanks. I was misinterpreting a simple match string’s (“end sub”) expected results as proof that the regex syntax was working properly without anchors/special characters. This gives expected results. Thank you.