Next: , Previous: , Up: Regular Expression Searching in Programs   [Index]


8.4.3.6 looking-back

Function: looking-back regexp limit &optional greedy

This function returns ‘t’ if REGEXP matches the text immediately before point (i.e., ending at point), and ‘nil’ otherwise.

REGEXP

the regexp to match against

LIMIT

You can bound the time required by specifying a non-‘nil’ value for LIMIT, which says not to search before LIMIT.

GREEDY

If GREEDY is non-‘nil’, this function extends the match backwards as far as possible, stopping when a single additional previous character cannot be part of a match for REGEXP. When the match is extended, its starting position is allowed to occur before LIMIT.