[Pharo-project] Regex with $? not working?
Hi guys. I am trying some regex expressions that involve '?' and they do not work. Try for example: '/<(\w+?)>([^<]+)/m' asRegex or '<([^/>]+)>([^<]*?)<\1>' asRegex and they all throw an error with the ? saying: 'RegexSyntaxError: nullable closure' Am I doing something wrong? Thanks, -- Mariano http://marianopeck.wordpress.com
Mariano Martinez Peck wrote
Am I doing something wrong?
You have to put what you're trying to match zero or one times first. For example: '.?' asRegex. 'a' matchesRegex: '.?'. "true" Browse implementor of c:syntax: for more info HTH, Sean -- View this message in context: http://forum.world.st/Regex-with-not-working-tp4669856p4669875.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
participants (2)
-
Mariano Martinez Peck -
Sean P. DeNigris