This is basically a general regex question tho I'm using the Java-flavor of it. I'm parsing a file containing variables wich are denoted by $name. I need to find all the variables for later use. However one syntax gives me a problem: $varName in $varList Here I only wish to match $varList. I've tried to use a negative lookahead like so: ...