[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bounds for strings with - between subwords
From: |
steve-humphreys |
Subject: |
bounds for strings with - between subwords |
Date: |
Fri, 7 May 2021 00:32:32 +0200 |
I am using the following function that gets me the bounds for each word.
But I have strings like
bibl-bellerive-etal-2016
which I want to get the bounds for strings with - between subwords.
--------
(defun alpha-bounds ()
"Gets bounds of a subword unit defined by regular expression [a-zA-Z]."
(let ( ($bounds nil) $ma $mb )
(skip-chars-backward "[:alpha:]")
(setq $ma (point))
(skip-chars-forward "[:alpha:]")
(setq $mb (point))
(setq $bounds (bounds-of-thing-at-point 'word))
(cons $ma $mb) ))
- bounds for strings with - between subwords,
steve-humphreys <=