BlackDragonBE Posted April 7, 2009 Posted April 7, 2009 (edited) Hi guys,I have a small problem, I have the following text:expandcollapse popupSortie Nouveau Ouvrir Radio Radio Liste des données Modif Données ListBox Tabellen ListBox X Liste des classes Nom: ABC_VDAT Type: Enkelvoudig Libellé: Begindatum Vrij Liste des données Modif Valider Bitmap Line Liste des données Caractéristiques Tabel: ABSCODE Kolom: VDAT Line Type: d Masque: dd/dd/dddd Lg : 10 cadr : Standaard Line Plage valeurs: Valeur défaut: Line AuditI need to get the text in red:Liste des classesNom:ABC_VDATType:EnkelvoudigI know it's always between "Nom:" and "Type:", I've been struggeling to get only that part of the text out..I'm not used to using regex, so I've been searching on google, but none of it made sense to me, I tried several ways but none worked.Can anyone please help?Thanks in advance,BlackDragonBE Edited April 7, 2009 by BlackDragonBE
picaxe Posted April 7, 2009 Posted April 7, 2009 This works for me$aRet = StringRegExp($string, '(?i)nom:(?>\r\n|\n)?(\S*)(?>\r\n|\n)?type:', 3) _ArrayDisplay($aRet)
TerarinK Posted April 7, 2009 Posted April 7, 2009 Is this on multiple topics that has this same format? If it is then I would just check for Nom: case insensitive at that and retrieve the next line. 0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E
Valuater Posted April 7, 2009 Posted April 7, 2009 I would just use a simple string-between function $Text = _StringBetween($String, "Nom:", "Type:") MsgBox(0x0,"Test", $Text[1]) 8)
BlackDragonBE Posted April 7, 2009 Author Posted April 7, 2009 Thanks a lot everyone! I decided to use Valuater's code, as it's the most simple. It's $Text[0] by the way I think, because it worked like a charm with a 0, but failed with a 1. Thanks again! BlackDragonBE
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now