all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Negative Lookahead Equivalent in emacs
@ 2017-05-09  5:15 luishenriquezperez
  2017-05-09  7:16 ` Emanuel Berg
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: luishenriquezperez @ 2017-05-09  5:15 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I'm trying to write a regex that matches the last character of a sequence of non-whitespace characters '[^\n\r\t\f ]', or an empty line matching ^$. 

Thus: 
Hello World! --> "o" and "!" would be matched

In non-elisp regex languages I know the code for this is: \S(?!\S) 
I know that \S is equivalent too [^ /n/r/t/f]. 
But I'm unsure of what the elisp equivalent (if any) of the negative lookahead (?!).

I saw on this forum a post  "gnu.emacs.help › regex nirvana - near miss"
Where Drew Adams said: "Typically, what you want to do for this in Emacs Lisp is to combine 
the use of a regexp for positive matching with other code that takes 
care of the non-matching (negation) need. "

However, I'm not sure how to go about doing this.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-05-10 15:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-09  5:15 Negative Lookahead Equivalent in emacs luishenriquezperez
2017-05-09  7:16 ` Emanuel Berg
2017-05-09  8:44 ` hector
2017-05-09  9:54 ` Wasell
2017-05-10 14:23   ` luishenriquezperez
2017-05-09 10:03 ` Felix Dietrich
2017-05-09 13:50 ` luishenriquezperez
2017-05-10  1:41   ` Emanuel Berg
2017-05-10 15:51 ` luishenriquezperez

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.