From: Douglas Livingstone Date: 2005-01-19T04:20:05+09:00 Subject: Re: My regexp stupidity needs assistance before loose all my hair! On Wed, 19 Jan 2005 02:29:37 +0900, Zach Dennis wrote: > which will match anything inside of square brackets. This will match: > > "This is a [fix]" $1 will equal "fix" > "This is a [ fix ]" $1 will equal " fix " > "This is a [ *sentence inside of a fix* ]" $1 will equal " *sentence > inside of a fix* " Hmm... I wonder if he wants to match that much, what about this input text: "I'm using square brackest in normal text [heh, this is [b]fun![b.]]" What do you want to match? "[heh, this is [b]" or "[b]"? Playing on your one, perhaps this is what is needed: /\[([^\[\]\s]*)\]/ Douglas