Python Forum

Full Version: regular expressions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i have a list of files that i want to select from for those with "in" in the name, where the "in" is not a part of "bin". that is, "bin" is to not match, but "in" with anything else in front, or at the beginning of the whole string, is considered to match. if both are present like "fooinbin" or "foobininbar" then the non-"bin" form of "in" being there, makes it match. what kind of regular expression can do this? i'm a dummy at making REs but i am wanting to use the egrep command, so an RE seems to be the way to go.