Msg#: 3505878 posted 5:08 pm on Nov 15, 2007 (gmt 0)
Hello, I am stuck trying to come up with a regular expression to validate, and then grab out into an array of the following data structure. I did not build this data structure but I am trying to work with it. Any ideas?
THE FORMAT OF THE DATA: Label "option1" "option2" "option3"
The Label is the first element of this and is not enclosed in quotes, the individual options however are enclosed in quotes.
So i need to validate that the user entered the data in this format with unlimited "options"
The second part would be to at a later time get this data and put it into an array with the "Label" as the  element of an array to make an array like this.
Msg#: 3505878 posted 9:37 pm on Nov 15, 2007 (gmt 0)
^([a-z])+ (\"([a-z])+\" )+$
will not match the Label "option1" etc that you posted. As you have only specified lower case letters in your classes (so Label wont match), and there is no digits in your quoted part (so option1 wont match).
$pattern = '%([a-z]+) ("[a-z]+\d"...space in here...?)+%i'; will match what you put up. Stupid forum removing spaces...
Dont know if your problem is sorted as you are using different data to the example, or if you havent tested your work. So this may, or may not help you ;)