Hi,

We're using IM 5.3.7 on Windows.

Ideally I'd like a simple true/false I could get when I do a
case-insensitive substring match, some thing like:

<pseudocode>
$animal="Leopard Frog"
IF the string $animal contains the string "frog", regardless of case, THEN
   $IsFrog=True   ; for example
END IF
</pseudocode>

I've read the Dev guide <http://download.intermapper.com/docs/DevGuide>, and
did not see built-in functions to check whether string A is contained within
string B, only equal or not equal.

IM does support regular expressions, so I thought I'd be set.  I've done a
lot of Perl programming and used regular expressions more than I care to
remember.

But IM's documentation of its regular expression syntax is minimal and
doesn't include any examples where you'd ignore case.  I've tried a few
things without luck.

Perl:
$plant = "Sunflower";
if ($plant =~ /FLOWER/i) {
  ... do something...  ; the regex will match because of the 'i' after the /
}

Intermapper:
<snmp-device-variables>
SysLocation,    1.3.6.1.2.1.1.6.0,    DEFAULT,    "SysLocation"
<!-- $Syslocation could be "Room 505" or "LIBRARY BASEMENT" for example -->
InBasement,     "$SysLocation" =~ "basement", CALCULATION
<!-- How do I get 'basement' to regex match 'BaSeMent' or any other case
variations? -->
<!-- And, how can I just have it be true/false or 1/0 if the regex matched?
-->
</snmp-device-variables>

Also, your only examples both show a search/replace being done.  I don't
want to do that when just checking whether one string contains another.

Thanks,
Ted
____________________________________________________________________
List archives: 
http://www.mail-archive.com/intermapper-talk%40list.dartware.com/
To unsubscribe: send email to: [email protected]

Reply via email to