[Gambas-user] PCRE component

Daniel Campos dcamposf at ...626...
Mon May 28 11:45:44 CEST 2007


The "\" symbol is used to determine special characters, like CR "\n",
so you have to put "\\" to represent each "\" symbol in a String.

Daniel


2007/5/28, David Paleino <d.paleino at ...626...>:
> Hi all,
> I've finally run Gambas again on my Debian (it rendered in an unusable
> way on my xfce), and I've started working again on some old projects.
> Now, my need is to parse the kernel list from kernel.org [1], that is
> something like:
>
> The latest stable version of the Linux kernel is:         2.6.21.3
> The latest prepatch for the stable Linux kernel tree is:  2.6.22-rc3
> The latest 2.4 version of the Linux kernel is:            2.4.34.4
> The latest prepatch for the 2.4 Linux kernel tree is:     2.4.35-pre4
> The latest 2.2 version of the Linux kernel is:            2.2.26
> The latest prepatch for the 2.2 Linux kernel tree is:     2.2.27-rc2
> The latest -mm patch to the stable Linux kernels is:      2.6.22-rc2-mm1
>
> Obviously, what I'm trying to have is the kernel version. I've come up
> with this regex (I've tried it with kregexpeditor):
>
> /[-. \d\w]*: *(\d.*)/
>
> Now, trying to put it in Gambas:
>
> DIM re AS Regexp
> re.Text = "/[-. \d\w]*: *(\d.*)/"
>
> When I run the program, Gambas tells me
>
> "Bad character constant in string at line <xx> in frmMain.class"
>
> I haven't been able what's the problem here. Any help? (if possible,
> also with the pattern itself, as I'm not a regexp guru :-) )
>
> Kind regards,
> David
>
> [1] http://www.kernel.org/kdist/finger_banner
>
> --
>  . ''`.  Debian packager! | http://snipurl.com/gofoxygo/
>  : :'  :   User #334216   |  http://www.hanskalabs.net/
>  `. `'`   GPG: 1392B174   | http://www.debianizzati.org/
>    `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list