Search code examples
emacselisp

An elisp function which checks whether the test-string match the regular expression?


Is there a function like (function-name regular-expression-string test-string) in elisp which checks whether the test-string and the regular-expresion-string match?

In my case, I need to use a regular expression to check whether the filename-string is a PDF filename-string.

For example,"/mnt/ntfs/dianzishu/pplib/plan/The_linux_virtual_memory_manager.pdf"

Update: I got it. string-match


Solution

  • The function is string-match.

    (string-match "\.pdf\'" file-name-string)