Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options answers only user 2094

is for patterns specifying search or replace strings. Also known as `regex` or `regexp`, the patterns describe strings to match when searching or replacing. Emacs provides extensive support for `regex` patterns in many commands. Emacs also provides an interactive expression builder for such patterns.

7
votes
This simple code: (looking-at "\\s)")
answered Sep 1 '15 by abo-abo
2
votes
In the first one, the or isn't escaped. I prefer a less fancy regex: "\\s-\\([^\n\t ]+\\)[ \n\t]" But it's a matter of taste, I guess.
answered Dec 28 '14 by abo-abo
3
votes
It's doable. M-x query-replace-regexp: from: ^\(\w+\)->\([^(]+\)() to: ::\2(\1, 42) But if it's a recurring pattern, it's best to solidify it in a function, instead of entering the regex each time …
answered Jan 2 '15 by abo-abo
2
votes
I think this should work for you: (setq dired-omit-files "^\\(?:\\..*\\|.*~\\)$")
answered Jan 23 '15 by abo-abo
1
vote
Check your setting of case-fold-search: Documentation: Non-nil if searches and matches should ignore case. This means you need (setq case-fold-search nil).
answered Jan 18 '16 by abo-abo
1
vote
You want: (let ((str "(test-func")) (if (string-match "^(\\(?:\\s_\\|\\sw\\)+" str) (message "ok") (message "no match"))) \\s_ will match stuff like -, while \\sw will actually match th …
answered Jan 30 '15 by abo-abo
2
votes
Let me just mention why I think this is not implemented in the core. Simply for efficiency reasons: there's no need to copy, create lists, pass them around and garbage collect them. Instead, store the …
answered Jan 8 '15 by abo-abo
8
votes
Use \(...\)for grouping and \1 to reference the first saved group (\2 for the second, all the way up to \9). E.g.: query-replace-regexp: _\([^_]+\)_ into /\1/. See Regexp Backslash in the Emacs Lisp …
answered Dec 8 '14 by abo-abo
6
votes
Look at this code: (replace-regexp-in-string "\\(http://localhost/~user/foo\.bar\\)\\(.+?\\)\"" "<?php foo() . '\\2'; ?>\"" "<img src=\"http://localhost/~user/foo.bar/place/foo_bar.jpg\" ... attr= …
answered Jul 15 '15 by abo-abo
3
votes
Try this: (defun filibuster (str) (interactive "sString: ") (save-excursion (goto-char (point-min)) (while (re-search-forward "^$" nil t) (replace-match str))))
answered Feb 24 '15 by abo-abo
1
vote
Your thing comes from the - not being defined a part of "\\w+" syntax, i.e. it thinks that a is a separate word, and the is a separate word. Just use this instead: (defun sort-words (reverse beg end …
answered Jan 19 '15 by abo-abo