elisp - How to match the whole string in Emacs Lisp -
i want math whole string *[123]*
, *[[123]]*
i not know how use elisp match these 2 different string.
not sure if need numbers or 123 string, here scenario matching numbers:
(progn (re-search-forward "\\*+\[[0-9]+]+\\*+") (message "%s" (match-string-no-properties 0)))
with grouped output:
(progn (re-search-forward "\\(\\*+\\)\\(\\[+\\)\\([0-9]+\\)\\(]+\\)\\(\\*+\\)") (message "%s %s %s %s %s" (match-string-no-properties 1) (match-string-no-properties 2) (match-string-no-properties 3) (match-string-no-properties 4) (match-string-no-properties 5)))
Comments
Post a Comment