Книга: Learning GNU Emacs, 3rd Edition
5.2.6.4 Using regular expressions to choose files
5.2.6.4 Using regular expressions to choose files
Often you want to select related files and either archive them, move them, compress them, or just delete them. Typically, you use wildcards to select multiple files. In Dired, you use regular expressions. To mark a group of files whose filenames match a regular expression, press % followed by m to mark them with an asterisk.
For example, let's mark all the files that start with ch. Remembering the quick lesson on regular expressions from Chapter 3, ^ finds the beginning of a word, so the regular expression ^ch would mark all the files that start with ch.
Type: %m
Emacs asks for a regular expression so that it can mark the files (Windows).
Type: ^ch Enter
Emacs marks all the files starting with ch and tells you how many it marked.
Sometimes it's more useful to mark files whose contents match a given regular expression. To mark files that contain a certain regular expression, type % g, followed by the regular expression to match (think g for grep if you're familiar with grep).
Now that we've got the files marked, let's talk about what to do with them.
- Regular Expressions
- 5.2.6 Working with Groups of Files
- 5.2.6.1 Selecting files
- 5.2.6.3 Selecting files by type
- IP filtering terms and expressions
- What NAT is used for and basic terms and expressions
- Caveats using NAT
- Using Double Quotes to Resolve Variables in Strings with Embedded Spaces
- Data Binding Using the GridView Control
- Using the kill Command to Control Processes
- Для чего нужны папки Windows, Documents and Settings, Program Files и Temp?
- Можно ли указать использование по умолчанию вместо C:Program Files другого каталога для установки программ?