Emacs manual regexp






















Syntax of Regular Expressions. This section (and this manual in general) describes regular expression features that users typically use. See Regular Expressions in The Emacs Lisp Reference Manual, for additional features used mainly in Lisp programs.. Regular expressions have a syntax in which a few characters are special constructs and the rest are ordinary. Regular Expression Search. A regular expression (regexp, for short) is a pattern that denotes a class of alternative strings to match, possibly infinitely many. In GNU Emacs, you can search for the next match for a regexp either incrementally or not. Incremental search for a regexp is done by typing C-M-s (isearch-forward-regexp). Regular Expression Searching. In GNU Emacs, you can search for the next match for a regular expression (see Syntax of Regexps) either incrementally or www.doorway.ru incremental search commands, see Regular Expression Search in The GNU Emacs www.doorway.ru we describe only the search functions useful in programs.


Regular expression searches are used extensively in GNU Emacs. The two functions, forward-sentence and forward-paragraph, illustrate these searches well. They use regular expressions to find where to move point. Use % g (command dired-mark-files-containing-regexp) to mark the Info files containing matches for your regexp. M-: (multi-isearch-files-regexp (dired-get-marked-files)), then type your regexp to search for matches (in the Info files that have matches). (You can turn that into a command if you want.). Function: regexp-quote string. This function returns a regular expression whose only exact match is string. Using this regular expression in looking-at will succeed only if the next characters in the buffer are string; using it in a search function will succeed if the text being searched contains string. See Regexp Search.


Interactive Highlighting by Matching. It is sometimes useful to temporarily highlight text that matches a certain regular expression. You can use regular expressions all over Emacs. About 15% of the pages in the Emacs manual mention regular expressions. read a file into Emacs C-x C-f save a file back to disk C-x C-s save all run Info tutorial h list Info commands? quit Info q search nodes for regexp s.

0コメント

  • 1000 / 1000