[Gambas-user] Problem with lazy regexp

T Lee Davidson t.lee.davidson at ...626...
Mon Apr 24 02:29:07 CEST 2017


According to http://gambaswiki.org/wiki/doc/pcre , using "*?" in a regular expression should lazily match 0 or more characters. 
However, it appears to act greedily.

I am trying to do some very simple HTML tag stripping with 'Regex.Replace(sText, "<.*?>", "")', and it takes out way more than 
just the tags.

Have I misunderstood the documentation?

(Project attached.)

-- 
Lee

[System]
Gambas=3.9.2
OperatingSystem=Linux
Kernel=4.4.57-18.3-default
Architecture=x86_64
Distribution=SuSE NAME="openSUSE Leap"
VERSION="42.2"
ID=opensuse
ID_LIKE="suse"
VERSION_ID="42.2"
PRETTY_NAME="openSUSE Leap 42.2"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:42.2"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
Desktop=KDE5
Theme=QtCurve
Language=en_US.UTF-8
Memory=3951M

[Libraries]
DBus=libdbus-1.so.3.8.14
OpenGL=libGL.so.1.2.0

[Environment]
(redacted)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lazyregextest-0.0.1.tar.gz
Type: application/gzip
Size: 12151 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20170423/01ad0cb7/attachment.gz>


More information about the User mailing list