Glycerine wrote:You sir speak entire swahili to me! HA - and it wasn't a rhetorical question
Anyhoo - the (?: ... ) thing is a conditional isnt it? or sort of 'match the expression (three dots. )
Okay, but no, the (?: ... ) is called a non-capturing group (details about it can be found here:
http://www.regular-expressions.info/named.html). You don't need it. What you do need is negative look ahead, check out this one:
http://www.regular-expressions.info/lookaround.html (which is what you probably meant by "conditional" I presume).
Glycerine wrote:The character class - I thought I did escape, n by doing ' [^][] ' I thought I was saying "don't match one of the square brackets".
But how does the regex engine know what the closing bracket of your character class is? If you want to include a square bracket in your character class, you need to escape it with a back slash.
More info:
http://www.regular-expressions.info/charclass.html
Glycerine wrote:And a greedy operator is " .+ " or " .? " isn't it.
Only the +, not the ?.
More info:
http://www.regular-expressions.info/repeat.html
Glycerine wrote:So you question can be interpreted as "Don't split a comma if your between ] or [" using that negative lookahead?
No, don't split on a comma when you can look ahead from that comma to a ']' without encountering a '['.
Glycerine wrote:I'll have another go.
And this time I'm giving you something - I have a bunch of books lying about the office. What do you want? (knowing you know the answer and your just dangling me by a string

)
Learn a man to fish instead of giving him one, and all that...
Really, if you were a bit closer to the solution, I would have shed some more light on it, but you're now simply guessing. ; )
I thought it was a rhetorical question because the answer to it could have easily been gotten by running a little test. So try a couple of things before posting a follow up. You'll be amazed by how much you learn by trial and error!
I'm off to bed right now, but I'll look at this thread tomorrow.
Best of luck, grasshopper!
; )