Tags:
create new tag
view all tags

Question

One more search question please...

If, within a search,

%CALC{"$pattern(.*</td><td>([^\n]*).*)"}%
Returns 02 Jul 2007 - 11:40

and

%CALC{"$TIME(02 Jul 2007 - 11:40)"}%

Returns 1183390800

Then why do I get 0 from

%CALC{"$TIME($pattern(.*</td><td>([^\n]*).*))"}%

?? Thanks

Environment

TWiki version: TWikiRelease04x00x05
TWiki plugins: SpreadSheetPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Search

-- MichelleAlbertin - 02 Jul 2007

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

Are you escaping CALC? I suspect (but have not real basis) that:

  1. CALC is not seeing any of it's functions in $pattern..., and returning the string unchanged, which then get's processed by search.
  2. CALC is converting the time, which is included as literal text in the search result
  3. CALC is running TIME on $pattern..., which doesn't look like a time string, and the result is being processed as literal text by SEARCH.

If my suspicion is correct, then you should escape CALC with $percnt and $quot.

-- JustinLove - 06 Jul 2007

Specifically, try

$percntCALC{$TIME($pattern(.*</td><td>([^\n]*).*))}$percnt
in your FormattedSearch.

-- PeterThoeny - 06 Jul 2007

Change status to:
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2007-07-06 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.