WatzNew
WatzNew
Your Personal Web Portal™A.I.Studio
Creative software development
Home | News | Features | Quick Tour | Download | Purchase | Partner Network | Support | Company | Site map
WatzNew > Support > Owner's Manual > Search patterns and message templates > Simple example of using search patternsEnglish | Russian

Simple example of using search patterns

WatzNew utilizes a simple to create yet powerful search pattern scheme to retrieve specific data from html pages. When the data is retrieved, WatzNew takes the message template to form a user-friendly message.

When the html page is loaded, WatzNew applies the search pattern first. The date / time macros are inserted before the search is performed, so you can make date-based search.

Sample search pattern:

<H1>{%}</H1>
This means: find the first occurence of <H1> in the html document and treat any text between it and the following occurence of </H1> as the first parameter (that corresponds to %1 in message template).

After then the extracted parameters are substituted into the message template.

Sample message template:

Current article: %1
This means: substitute %1 with the first parameter found.

If we apply the above rules to the following sample html document
...
<BODY>
<H1>"How to become rich?" by John Poor</H1>
...
</BODY>
we will get "Current article: "How to become rich?" by John Poor" message.

Now, when the text between <H1> and </H1> is changed, we will be notified with such a message as soon as WatzNew checks the channel for updates.

Note: Pattern search is case-insensitive but date / time macros that are inserted before search, are case-sensitive; each found parameter is processed on the following scheme: html tags (simply all text between < and >) are stripped; all &nbsp; are converted to spaces; all &nn; and &nnn; and such codes as &copy;, &reg;, &quot; are converted to corresponding characters; the resulting strings are trimmed (all leading and trailing spaces and control characters are removed).

Please take a look at the more complex example of using search patterns and message templates.

Order Now!
Download Trial

See next

© 1998 – 2004 A.I.Studio. All rights reserved.
Contacts | Legal Information


Back to top