Wrox Programmer Forums
|
BOOK: Beginning Regular Expressions
This is the forum to discuss the Wrox book Beginning Regular Expressions by Andrew Watt; ISBN: 9780764574894
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Regular Expressions section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 11th, 2005, 03:22 AM
Registered User
 
Join Date: Nov 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default splitting windows ini file format

Hello all

Would anybody know how I split the example below and have the sections [Core] seperated (without the brakets) in one statement and in another split all remaining text at the = sign.

Would appreciate your help and hints

Thank you

Roland

[Core]
Student_ID=ee
Student_Name=Smith, Peter
Output_File=c:\program files\xyz\data\tempCredit=C
Lesson_Location=
Lesson_Status=N
Path=c:\program files\xyz\data\temp\Score=0
Time=00:00:00
Lesson_Mode=I

[Core_Lesson]
value1 = 1
value2 = 2
value2 = 3

 
Old October 24th, 2006, 06:59 AM
Registered User
 
Join Date: Oct 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is an expression to match sections titles:

\[(.*)\]\n

And one to match each sub statement:

(?<=[\r\n])([^=\r\n]+)=([^\r\n]*)



Regular expression database (regex.fr)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Read data from ini file nbryson VB How-To 5 April 2nd, 2015 05:14 AM
Reading an INI file in C# @shish C# 1 April 1st, 2015 04:00 AM
ini file ptop C++ Programming 0 January 30th, 2006 06:29 AM
How to Read from INI file alen Pro VB 6 2 September 3rd, 2004 06:34 AM
INI file access jlick Pro VB 6 4 November 7th, 2003 05:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.