Function: word-search-backward-lax

word-search-backward-lax is an interactive and byte-compiled function defined in isearch.el.gz.

Signature

(word-search-backward-lax STRING &optional BOUND NOERROR COUNT)

Documentation

Search backward from point for STRING, ignoring differences in punctuation.

Set point to the beginning of the occurrence found, and return point.

Unlike word-search-backward, the end of STRING need not match a word boundary, unless STRING ends in whitespace.

An optional second argument bounds the search; it is a buffer position.
  The match found must not begin before that position. A value of nil
  means search to the beginning of the accessible portion of the buffer.
Optional third argument, if t, means if fail just return nil (no error).
  If not nil and not t, position at limit of search and return nil.
Optional fourth argument COUNT, if a positive number, means to search
  for COUNT successive occurrences. If COUNT is negative, search
  forward, instead of backward, for -COUNT occurrences. A value of
  nil means the same as 1.
With COUNT positive, the match found is the COUNTth to last one (or
  last, if COUNT is 1 or nil) in the buffer located entirely before
  the origin of the search; correspondingly with COUNT negative.

Relies on the function word-search-regexp to convert a sequence of words in STRING to a regexp used to search words without regard to punctuation. This command does not support character folding, and lax space matching has no effect on it.

Probably introduced at or before Emacs version 23.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/isearch.el.gz
(defun word-search-backward-lax (string &optional bound noerror count)
  "Search backward from point for STRING, ignoring differences in punctuation.
Set point to the beginning of the occurrence found, and return point.

Unlike `word-search-backward', the end of STRING need not match a word
boundary, unless STRING ends in whitespace.

An optional second argument bounds the search; it is a buffer position.
  The match found must not begin before that position.  A value of nil
  means search to the beginning of the accessible portion of the buffer.
Optional third argument, if t, means if fail just return nil (no error).
  If not nil and not t, position at limit of search and return nil.
Optional fourth argument COUNT, if a positive number, means to search
  for COUNT successive occurrences.  If COUNT is negative, search
  forward, instead of backward, for -COUNT occurrences.  A value of
  nil means the same as 1.
With COUNT positive, the match found is the COUNTth to last one (or
  last, if COUNT is 1 or nil) in the buffer located entirely before
  the origin of the search; correspondingly with COUNT negative.

Relies on the function `word-search-regexp' to convert a sequence
of words in STRING to a regexp used to search words without regard
to punctuation.
This command does not support character folding, and lax space matching
has no effect on it."
  (interactive "sWord search backward: ")
  (re-search-backward (word-search-regexp string t) bound noerror count))