Re: regular expression problem



condor wrote:
I want to select a text between square brackets. As it may contain
accents and punctuation I try to use the negation:

"\[([^\]])\]"

However, this does not work and the problem is with the closing square
bracket ("]").

My questions are:
- Is "\]" some reserved sequence with a special meaning.
- if so, how can I work around that and still get functionality I want


I think you want "\[([^\]]*?)\]"
.



Relevant Pages

  • Re: regular expression problem
    ... accents and punctuation I try to use the negation: ... this does not work and the problem is with the closing square ... bracket. ...
    (php.general)
  • Re: regular expression problem
    ... accents and punctuation I try to use the negation: ... this does not work and the problem is with the closing square ... bracket. ...
    (php.general)
  • Re: Strange login message (-bash: [: missing `])
    ... mirek wrote: ... There needs to be a space between the directories and the closing square ... bracket. ... JohnK ...
    (alt.os.linux.suse)