help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to check regexp for syntax-errors? (There HAS to be SOME way, yes?)


From: David Combs
Subject: How to check regexp for syntax-errors? (There HAS to be SOME way, yes?)
Date: 16 Oct 2009 13:19:04 -0400

Trying to get this to work:

Trying to come up with a "dired-do-rename-regexp" that will transform
filenames like in these Dired-lines, I get an error printout.



  -rw-rw-rw-   1 David    root      10895733 10-16 09:51 
091005_100001pilotmon.MP3
  -rw-rw-rw-   1 David    root      10895675 10-16 09:49 
091012_100001pilotmon.MP3
  -rw-rw-rw-   1 David    root      10895673 10-16 09:49 091012_080001dn.MP3
  -rw-rw-rw-   1 David    root      10982376 10-16 09:48 
091015_090001freeforum.MP3
  -rw-rw-rw-   1 David    root      10895675 10-16 09:47 091015_080001dn.MP3    
,

So, I simplify to an Occur, and so do M-: on this:

(Occur 
"\\([0-9][0-9]\\)\\([0-9][0-9]\\)\\([0-9][0-9]\\)_\\([0-9][0-9][0-9][0-9][0-9][0-9]\\)1\\([a-zA-Z\\][0-9a-zA-Z]*\\).mp3")
     ,

But here's what I get back:


Debugger entered--Lisp error: (void-function Occur)
  (Occur 
"\\([0-9][0-9]\\)\\([0-9][0-9]\\)\\([0-9][0-9]\\)_\\([0-9][0-9][0-9][0-9][0-9][0-9]\\)1\\([a-zA-Z\\][0-9a-zA-Z]*\\).mp3")
  eval((Occur 
"\\([0-9][0-9]\\)\\([0-9][0-9]\\)\\([0-9][0-9]\\)_\\([0-9][0-9][0-9][0-9][0-9][0-9]\\)1\\([a-zA-Z\\][0-9a-zA-Z]*\\).mp3"))
  eval-expression((Occur 
"\\([0-9][0-9]\\)\\([0-9][0-9]\\)\\([0-9][0-9]\\)_\\([0-9][0-9][0-9][0-9][0-9][0-9]\\)1\\([a-zA-Z\\][0-9a-zA-Z]*\\).mp3")
 nil)
  call-interactively(eval-expression)
  recursive-edit()
  byte-code("  @ = !


Which is completely "Greek" to me!




Isn't there some .el that that will try to parse a regexp, and tell
me where it got confused, and what to look for for errors?


Thanks!




David




reply via email to

[Prev in Thread] Current Thread [Next in Thread]