Go to the first, previous, next, last section, table of contents.


String Matching

Function: looking-at regexp &optional pos buffer ignore-case
Returns t if the regular expression regexp matches the text at position pos in the buffer buffer (or the current buffer).

Only the text from pos to the end of the line is matched against.

Function: regexp-match regexp string &optional ignore-case
This function returns t if the regular expression regexp matches the string string.

Note that the match is unanchored so if you want test for a match of the whole of string use the `^' and `$' regexp meta-characters. For example,

(regexp-match "(a|b)+" "fooabababar")
    => t

(regexp-match "^(a|b)+$" "fooabababar")
    => nil

(regexp-match "^(a|b)+$" "ababbabba")
    => t

When the ignore-case argument is non-nil the case of strings being matched is insignificant (except in character ranges).

Function: regexp-expand regexp string template &optional ignore-case
This function matches the regular expression regexp against the string string, if the match is successful a string is created by expanding the template string template.

For details of what meta-characters are allowed in template see section Regular Expressions.

(regexp-expand "^([a-z]+):([0-9]+)$"
               "foobar:42"
               "The \\1 is \\2.")
    => "The foobar is 42."

Function: regexp-match-line regexp &optional line-pos buffer ignore-case
This function is similar to regexp-match, instead of explicitly supplying the string to match against it is one whole line of the specified buffer, the line pointed to by line-pos (or the line that the cursor is on).

t is returned if the match is successful.

Function: regexp-expand-line regexp template &optional line-pos buffer ignore-case
As regexp-match-line is similar to regexp-match, this function is similar to regexp-expand.

The whole of the line at the position line-pos (or the cursor) is matched with the regular expression regexp. If the match is successful the template is used to expand a string which is returned.


Go to the first, previous, next, last section, table of contents.