Rivka Miller wrote: > I am looking for a regexp for a string not at the beginning of the > line. > > For example, I want to find $hello$ that does not occur at the > beginning of the string, ie all $hello$ that exclude ^$hello$.
The begging of the string is zero width character. So you could use negative lookahead (?!^). Then the regular expression looks like: /(?!^)\$hello\$/g var str = '$hello$ should not be selected but', str1 = 'not hello but all of the $hello$ and $hello$ ... $hello$ each one '; str.match(/(?!^)\$hello\$/g); //null str1.match(/(?!^)\$hello\$/g); //["$hello$", "$hello$", "$hello$"] -- http://mail.python.org/mailman/listinfo/python-list