Hi,

I forgot this part...

Please update the documentation with this (very useful!) information.  Now
the docs basically read, "IM supports regex, and here's a link where you can
learn about regex."

The docs should show an example of a simple pattern match, instead of a
search/replace, as you explained in your answer to me.
They should also state that case-insensitive matching is currently not
implemented, other than to do the [Aa][Bb] type of syntax workaround.

Those simple bits of info would have saved me a lot of time!  Other regex
functionality not yet implemented should be listed also.  You can't list
everything probably, but big ones--such as no /string/i is pretty
big--should be listed.

Lastly, a feature request.  Please add /string/i type case-insensitive
matching to the IM regex implementation.

Thanks,
Ted

On Wed, Mar 23, 2011 at 4:25 PM, Ted Fines <[email protected]> wrote:

> Hi,
>
> That worked, thanks.  I added a line to the snmp-device-thresholds section
> to check $InBasement for 1/0, and it works like I'd expect and wanted!
>
> Thanks,
> Ted
>
>
> On Wed, Mar 23, 2011 at 1:12 PM, William Fisher <
> [email protected]> wrote:
>
>> On 3/23/11 1:58 PM, Ted Fines wrote:
>>
>>> Ideally I'd like a simple true/false I could get when I do a
>>> case-insensitive substring match, some thing like:
>>>
>>> [...]
>>>
>>>
>>> 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
>>>
>> The current syntax is case-sensitive only. To simulate a case-insensitive
>> comparison, you'll need to use character classes:
>>
>> InBasement,     "$SysLocation" =~ "[bB][aA][sS][eE][mM][eE][nN][tT]",
>> CALCULATION
>>
>>
>> The resulting value ($InBasement) should be 1 if the expression matches.
>>
>> --
>> Bill Fisher
>> Dartware, LLC
>> ____________________________________________________________________
>> List archives:
>> http://www.mail-archive.com/intermapper-talk%40list.dartware.com/
>> To unsubscribe: send email to: [email protected]
>>
>>
>
____________________________________________________________________
List archives: 
http://www.mail-archive.com/intermapper-talk%40list.dartware.com/
To unsubscribe: send email to: [email protected]

Reply via email to