emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Regexp problem: org-mode and remind integration
@ 2009-01-14  2:05 Daniel Martins
  2009-01-17  8:16 ` Carsten Dominik
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Martins @ 2009-01-14  2:05 UTC (permalink / raw)
  To: Olaf Dietsche; +Cc: bastien.guerry, Emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1454 bytes --]

Sorry for the confusion,

I did try the empty regexp as suggested and it "worked" ie no problem
appeared.

My problem is to find a regexp for timestamps outside DEADLINE: and
SCHEDULE: rows

In other words, given three variables A B C with regexps.

If I have a regexp given by variable A and I want to find a text which
satisfies A but DO NOT satisfy B nor C how can I write uch regexp?

2009/1/13 Olaf Dietsche
<olaf+list.orgmode@olafdietsche.de<olaf%2Blist.orgmode@olafdietsche.de>
>

> "Daniel Martins" <danielemc@gmail.com> writes:
>
> > I did your test wuth a null regexp
> >
> > It is a regexp problem!
> >
> > Org-mode has two variables: org-deadline-string and org-scheduled-string
> > (see below)
> >
> > and I want to match tasks which have a timestamp, ie satisfies the
> > org-ts-regexp2
> >
> > BUT DO NOT  have org-deadline-string NOR org-scheduled-string
> >
> > I tried
> >
> >     (org2rem-pure-timestamps-string
> >           (concat  "\\(" org-deadline-string "\\|"
> >                org-scheduled-string  "\\)\\{0\\}"))
> >
> > in order that a regexp such as
> >
> > "\\(org-deadline-string\\|org-scheduled-string\\)\\{0\\}"
> >
> > would match only zero {0} occurrences of
> > (org-deadline-string|org-scheduled-string)
> > but this seems to be a mistake.
> >
> > Any hint??
>
> I can only suggest the empty regexp, as before:
>
>     (org2rem-pure-timestamps-string "")
>
> If this doesn't work, I don't know.
>
> Regards, Olaf
>

[-- Attachment #1.2: Type: text/html, Size: 2151 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Regexp problem: org-mode and remind integration
  2009-01-14  2:05 Regexp problem: org-mode and remind integration Daniel Martins
@ 2009-01-17  8:16 ` Carsten Dominik
  0 siblings, 0 replies; 2+ messages in thread
From: Carsten Dominik @ 2009-01-17  8:16 UTC (permalink / raw)
  To: Daniel Martins; +Cc: bastien.guerry, Emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2326 bytes --]


On Jan 14, 2009, at 3:05 AM, Daniel Martins wrote:

> Sorry for the confusion,
>
> I did try the empty regexp as suggested and it "worked" ie no  
> problem appeared.
>
> My problem is to find a regexp for timestamps outside DEADLINE: and  
> SCHEDULE: rows
>
> In other words, given three variables A B C with regexps.
>
> If I have a regexp given by variable A and I want to find a text  
> which satisfies A but DO NOT satisfy B nor C how can I write uch  
> regexp?


You cannot.  The only way is to first find A, then remember
your position and look around the match to make sure that the
location does not also match the others.

For example:

(let (tmp-string)
   (while (re-search-forward "<.*?>" nil t)
     ;; we have a match of something between angular brackets
     ;; now grab a string before the beginning of the match
     (setq tmp-string (buffer-substring
		      (max (point-min) (- (match-beginning 0) 20))
		      (match-beginning 0)))
     ;; no check if this string contains DEADLINE of SCHEDULED
     (when (save-match-data ;; to not loose the info about the  
original match
	    (and (not (string-match "DEADLINE:") tmp-string)
		 (not (string-match "SCHEDULED:") tmp-string)))
       ;; ok, this is one of the locations we wanted
      ......


HTH

- Carsten

>
>
> 2009/1/13 Olaf Dietsche <olaf+list.orgmode@olafdietsche.de>
> "Daniel Martins" <danielemc@gmail.com> writes:
>
> > I did your test wuth a null regexp
> >
> > It is a regexp problem!
> >
> > Org-mode has two variables: org-deadline-string and org-scheduled- 
> string
> > (see below)
> >
> > and I want to match tasks which have a timestamp, ie satisfies the
> > org-ts-regexp2
> >
> > BUT DO NOT  have org-deadline-string NOR org-scheduled-string
> >
> > I tried
> >
> >     (org2rem-pure-timestamps-string
> >           (concat  "\\(" org-deadline-string "\\|"
> >                org-scheduled-string  "\\)\\{0\\}"))
> >
> > in order that a regexp such as
> >
> > "\\(org-deadline-string\\|org-scheduled-string\\)\\{0\\}"
> >
> > would match only zero {0} occurrences of
> > (org-deadline-string|org-scheduled-string)
> > but this seems to be a mistake.
> >
> > Any hint??
>
> I can only suggest the empty regexp, as before:
>
>     (org2rem-pure-timestamps-string "")
>
> If this doesn't work, I don't know.
>
> Regards, Olaf
>


[-- Attachment #1.2: Type: text/html, Size: 3816 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

end of thread, other threads:[~2009-01-17  8:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-14  2:05 Regexp problem: org-mode and remind integration Daniel Martins
2009-01-17  8:16 ` Carsten Dominik

Code repositories for project(s) associated with this inbox:

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).