Main purpose is to find the correct keyword from a pattern. Suppose SUPPLIERCODE-ITEMCODE-GRNDATE-COSTPRICE is a patter. Using regular expression system will be able to find ITEMCODE from here.
- Applicable to New Item Search Form
- Set Regular Expression, A sample is here:
<data>
<rules>
<parentElementRE>^*([_A-Za-z0-9\.]{3,10})*-([_A-Za-z0-9\.]{3,20})*-([_A-Za-z0-9]{4})*-([_A-Za-z0-9]{4})$</parentElementRE>
<separator>-</separator>
<keywordPosition>1</keywordPosition>
<child>
<childName>ItemCode</childName><childElementRE>^*([_A-Za-z0-9\.]{6,10})$</childElementRE>
<childName>BatchNumber</childName><childElementRE></childElementRE>
<childName>keyword</childName><childElementRE></childElementRE>
</child>
</rules>
</data>
Here mandatory tags are:
- parentElementRE => Main Regular Expression to identify a pattern. System will continue looking at this Regular Expression if only this pattern matches with input search keyword
- separator => This is used to separate elements in Regular Expression. Suppose the whole keyword consist itemcode-batchcode-price. Here '-' is a separator
- keywordPosition => keywordPosition or child, only 1 of these 2 will be used. If keywordPosition is mentioned system will take the keyword from that position only. Suppose above pattern has combination of 4 different elements. If keywordPosition is 2 then system will consider 2nd element as keyword
- child => child tag has 2 sub tags:
1. childName: Currently it supports ItemCode or BatchNumber or keyword.
2. childElementRE: Regular Expression to identify child from long keyword
If ItemCode is mentioned in childName and it has a regular expression in childElementRE then system will match pattern and findout the itemcode from the long keyword
If BatchNumber is mentioned in childName and it has a regular expression in childElementRE then system will match pattern and findout the batchNumber from the long keyword. Later with the combination of ItemCode and BatchNumber the correct item with BatchNumber will be selected
If keyword is mentioned in childName and it has a regular expression in childelementRE then system will match pattern and findout the keyword from the long keyword.
This Regular Expression mainly used to find keyword from a pattern. Now it's applicable to Item Search.