|
-
May 26th, 2010, 08:11 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Regex question
I was trying to write a regular expression to look for the following conditions and am having trouble understanding how to do it. It's for reading an INI file. I know there is code out there to do this but would like to understand how to do it myself.
Here are the conditions for one line read from a text file:
1. contains one and only one '[' AND one and only one ']'
2. returns the data between the brackets
3. provides some information that allows me to trap an error if it's not a properly formatted section heading. ([[text], text], etc)
Here's what I was trying to use "\[\(.*\)\]" with regex.matches.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|