[Gambas-user] Re gular Expression Help

M0E Lnx m0e.lnx at ...626...
Tue May 27 15:51:08 CEST 2008


why not just do some text splitting to get what you need?

If you have "sda1" and you only want "sda" out of that... you should
be able to go with Newstring=left(sStr, 3)



On 5/27/08, hinchy <eoinhinchy at ...626...> wrote:
>
>  keywords: regex, Regular Expression, regexp, pcre
>
>  Hi guys,
>
>  I've been struggling with the pcre component for a couple of days now. I'm
>  running the command:
>  SHELL "ls /dev | grep [sh]d[a-z]" TO sStr
>
>  This will return something along the lines of:
>  sda
>  sda1
>  sda2
>
>  I then want to run the regular expression ^[^\s]*+ against sStr to return
>  sda for saving in a different string but I can't for the life of my figure
>  it out.
>  Any ideas? I'm sure it's quite simple I just can't get it together.
>  Thanks,
>  Eoin
>  --
>  View this message in context: http://www.nabble.com/Regular-Expression-Help-tp17488070p17488070.html
>  Sent from the gambas-user mailing list archive at Nabble.com.
>
>
>  -------------------------------------------------------------------------
>  This SF.net email is sponsored by: Microsoft
>  Defy all challenges. Microsoft(R) Visual Studio 2008.
>  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>  _______________________________________________
>  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