Skip to main content
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
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
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 not deleted user 454

Questions about search mechanics inside of Emacs.

1 vote
Accepted

Binary search in elisp, do away with the return variable

Your algorithm looks to me like this: (defun bnry-srch (vctr itm strt end) "Searches for the item ITM in the vector VCTR. strt is usually 0 and end is vctr's length-1" (if (>= end strt) (let …
phils's user avatar
  • 53k
3 votes
Accepted

calling search-forward function with ^ and $ in the regexp pattern

You're getting tripped up by the escaping requirements for Emacs regexps when expressed in the double-quoted read syntax for strings, in conjunction with some historical-compatibility behaviour in Ema …
phils's user avatar
  • 53k
1 vote

How to delete numerals of a certain size from text

... a way to search for and delete numerals above a certain value I think column-based solutions make more sense in this case but, just for fun, here's an interactive way you could delete numerals … above a certain value using search-and-replace: M-x replace-regexp RET \b\([0-9]\{6,\}\)\b RET \,(if (> \#1 164000) "" \1) RET Which will turn your example into: PSALMS 150 5 164000 Praise …
phils's user avatar
  • 53k
2 votes
Accepted

Complex searching and replacing

You can use M-x replace-regexp or M-x query-replace-regexp. e.g.: C-M-% throw \(".*?"\); RET throw new Error(\1); RET If "some message" might contain escaped double-quotes like "whoops, \"foo\" hap …
phils's user avatar
  • 53k
2 votes
Accepted

How to include lines in a regular expression search which might not be present?

? is the zero-or-one quantifier: \\(...\\)? says the group may or may not match anything. Make it non-capturing if you don't care about backreferences to that group: \\(?:...\\)? I tried this bu …
phils's user avatar
  • 53k
1 vote

How to match first character in line after asteriks and space using regex?

You can, of course, search for: ^\*+ \(.\) aka "^\\*+ \\(.\\)" And then you'll have the character you wanted in the matched sub-group. It all depends on what you're doing, though. …
phils's user avatar
  • 53k
1 vote
Accepted

How to search with a regexp before point?

searches guarantee the longest match in any case, which is why we have C-hig (elisp)POSIX Regexps -- but those also don't behave any differently with respect to the backwards-search start-point issue, … and so using posix-search-backward doesn't change the outcome of your example at all. …
phils's user avatar
  • 53k
0 votes

Regexp: Regexp that matches ")" but NOT "()"

It sounds like you can search for [^(]) and then move point to the last position of that match. …
phils's user avatar
  • 53k
1 vote

How to find all characters, newlines included?

I struggled to parse that question, but I think you're asking for the regexp syntax which means "Any character -- even a newline character." You have tried using this: [.^J ] (where ^J here (and …
phils's user avatar
  • 53k
0 votes
Accepted

How to bypass lines matching some regexp, when searching forward

As with any search, (search-forward-regexp mylog-mode-error-regexp) produces match data which you can easily use to perform further processing on what the search found. … (while (and (search-forward-regexp mylog-mode-error-regexp) (save-excursion (save-restriction (narrow-to-region (match-beginning 0) (match-end 0)) …
phils's user avatar
  • 53k
1 vote

Change Case of last searched pattern

For a vanilla Emacs approach, you might use: C-sM-c to initiate a case-sensitive search (assuming that you have isearch-case-fold-search enabled by default). … C-w to search/match the word at point (or whatever you need to do to isearch the thing you're looking at/for). M-% to enter the case-sensitive replacement for all matches. …
phils's user avatar
  • 53k
2 votes

Search for occurrence of character within a string without using the common lisp library?

It looks like you ultimately want the characters between % and & in the buffer name? You might do this: (let ((s (buffer-name))) (string-match "%\\(.*?\\)&" s) (match-string 1 s))
phils's user avatar
  • 53k
1 vote
Accepted

What am I supposed to do about the error “Invalid search bound (wrong side of point)” in my ...

Should I use a marker manually Yes, if you are repeatedly searching and replacing within the same initial beg end region, you need to use a marker to ensure that the bounds remain sane from one iter …
phils's user avatar
  • 53k
2 votes

Search for "foo bar" ignoring comments and newlines

I can fake this via C-hv search-whitespace-regexp It wouldn't be a full solution unless your comment marker character could never occur in any other context (e.g. the string "100%"). … (progn (setq-local search-whitespace-regexp "\\([[:space:]\n]\\|%. …
phils's user avatar
  • 53k
1 vote

Search/replace inside a rectangular region, without CUA mode

Consider this question: Search and replace inside a rectangle in emacs That's what I want, except I'm not using CUA mode. … I'm confused by your question, because the bulk of the accepted answer to the question you have linked to is dedicated to achieving that very goal -- search and replace within a rectangle without using …
phils's user avatar
  • 53k

15 30 50 per page