| Author |
Message |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 08/08/2010 15:47:57
|
fclauson
Initiate
Joined: 21/05/2010 07:55:11
Messages: 56
Location: Ireland
Offline
|
Given that regex is very poor at stating something was not found what would be the best way of testing a web page with the following
if "ABC" found on page then return 1 else return 0
This message was edited 1 time. Last update was at 11/08/2010 10:06:37
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 08/08/2010 23:12:19
|
mlohbihler
Master
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.png)
Joined: 01/03/2007 22:48:52
Messages: 1847
Offline
|
Hmm, there is a roundabout way, although it's not entirely clean...
If you leave the "ignore if missing" checkbox unchecked, you will get an event raised if the specified group is empty. You can then use this event to set the value of another point (say, a virtual point with "no change"), and go from there. I haven't tested this myself, but in theory it should be ok.
|
Best regards,
Matthew Lohbihler |
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 10/08/2010 02:54:02
|
fclauson
Initiate
Joined: 21/05/2010 07:55:11
Messages: 56
Location: Ireland
Offline
|
finally worked this out
HTTP page reads "This is a document"
use HTTP retreiver and point type binary
Regex : ".*(is.?) *"
do not use inverted commers (done for clarity here) and note space after the closing bracket which captures the space before the "a"
This regex returns TRUE
change regex to
".*(ix.?) *" (again note space a do not use inverted commas)
returns FALSE
if you need any help drop me a PM
Francis
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 11/08/2010 10:06:09
|
fclauson
Initiate
Joined: 21/05/2010 07:55:11
Messages: 56
Location: Ireland
Offline
|
Having tried more combinations it is now apparrent that my previous email is not always true
Serotonin - can we have some clarity on how this is supposed to work specifically
1 - the test button - does this work exactly the same as when the product is running live (i.e. does it take account of the Binary 0 value)
2 - when it says "No value match made for point " could the message be clearer as to what the problem is as this error is returned for multiple errors I think
3 - what would be the quickest way of constructing a test harness to test out regex as implemented by Mango as getting regex working is a big pain
Many thanks
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 12/08/2010 23:29:57
|
mlohbihler
Master
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.png)
Joined: 01/03/2007 22:48:52
Messages: 1847
Offline
|
1 - Yes
2 - When Matcher.match returns false, that message is shown. Can you enumerate the multiple errors you think this is returned for?
3 - Personally, i use QuickREx, a plugin for Eclipse by Bastian Bergerhoff, and i recommend it. If you're not using Eclipse there are probably similar tools around. Find a Java-based one to be sure you're using the same pattern compiler/matcher as Mango.
|
Best regards,
Matthew Lohbihler |
|
|
 |
|
|