UCMDB and UD Practitioners Forum (Previously CMS)
cancel

Limits of Regular Expressions in Enrichment Rules

Highlighted
garciagi
Contributor.

Limits of Regular Expressions in Enrichment Rules

Hello. So many questions.

Is there a guide on the limits/capabilities of regex for enrichment rules?

I'm new to python/jython but conditional groups don't seem to work...variables don't seem to work.

My current problem is trying to populate Attribute A with a string based on a variable value of Attribute B.

Also, how to control the output? 

As a sample:

Regular Expression:

(sql)(exc)|(fps)

RegExp Group

1

Populates Attribute B with sql... how do I translate to SQL Server?

Why doesn't something like this work?

(?:.{4})((sql)|(exc)|(fps))(?:.*)(?(1)SQL Server)(?(2)Exchange Server)(?(3)File Print Server)

Short of making an enrichment for each possibility, my cheap work around was to drop in three of the same query node, apply a virtual join, then apply the same conditions to each of them where only the variable and enrichment result is different.

This works for a small sample, but I have other conditions for other attributes with many possible outcomes.

Is this better suited for a custom adapter/discovery?

Any suggestions?