Hello,

I would like some help using the Submatches property of the Regexp feature
in Gambas.

For example, I want to find all non-whitespace characters in the string
"Gambas", and
iterate through them.  I tried code like this:

DIM rege AS NEW Regexp
  DIM i AS Integer

  ' The \S is a non-whitespace character
  ' See http://www.perl.com/doc/manual/html/pod/perlre.html
  ' The other left \ is to escape the right \, so that Gambas isn't
confused.
  rege.Compile("(\\S)")
  rege.Exec("gambas")

  FOR i = 1 TO rege.SubMatches.count
    Message(rege.SubMatches[i].Text)
  NEXT

But I can only get it to print out the "g" character.

I want to use more complex regular expressions, which is why I'm not using
the LIKE and
SPLIT functions of the String object.

Can anyone help?  I'm running Gambas 2.0.0 on Ubuntu Linux
Thanks,
--Nate
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to