In Emacs Dired mode, I'd like to mark directories and files whose names begin with Addr but not files that contain Addr inside the name. I'm using RE-Builder to test my regular expressions and am having no luck with the carat (^) character. I know it can mean beginning-of-line or else it can mean not.I ultimately would like to use %g in Dired mode but am using RE-Builder because it lets me see what my regular expression does. The rx macro is beyond me right now.^Addr.* does not do what I want. The ^ character apparently means not rather than beginning-of-line. Addr.* also finds names like blahAddrblah, which is not what I want.What's the regexp trick that I need?
emacs dired regexp mark files beginning with
regular expression;emacs
^Addr does match Addr at the beginning of a line. The character ^ only means not when it's at the beginning of a character class, e.g. [^abc] means any one character that isn't a, b or c.I think your problem is that you're using the command %g, which matches files by their content, but you meant to use %m, which matches files by their name. %m ^Addr RET marks files whose name begins with Addr.