Closed kabassanov closed 2 years ago
Hi,
I pushed a commit to handle more cases (with prefix and/or suffix and extra chars inside <>
and also when string contains other <
and >
.
Could you test it ?
Hi, OK, I'll try to test tomorrow. But I wonder what is the meaning of autonum and the end of mask filter (in particular < at the beginning and the # mark at the end...
(?<autonum>[^<#]*(?<mask>#{1,10})[^#>]*)
Hi,
/
^(?<prefix>.*) # capture every char located before the "autonum" part
< # "<" char that indicates beginning of the "autonum" part
(?<autonum>
[^<#>]* # any char that is not "#", "<" or ">"
(?<mask>#{1,10}) # mask part
[^<#>]* # any char that is not "#", "<" or ">"
)
> # ">" char that indicates ending the "autonum" part
(?<suffix>.*)$ # capture every char located after the "autonum" part
/
Hi, I used the following test sets ang got these results:
24. INV-<SUB>####> INV-####> *
25. INV-<####<SUB> INV-####> **
I hope I didn't miss some important cases...
I will try to handle these cases properly.
Didn't take care, but 8130 is also displayed in a particular way:
I updated the pattern and the way we find mask length.
It should result in
Case n° | pattern | before | after |
---|---|---|---|
11 | INV-<#SUB####> |
INV-<#SUB####> |
INV-#SUB0011 |
12 | INV-<SUB#SUB-####> |
INV- |
INV-SUB#SUB-0012 |
14 | INV-<#SUB-####> |
INV-<#SUB-####> |
INV-#SUB-0014 |
15 | INV-<###########> |
INV-<###########> |
INV-0000000015# |
19 | INV-<####-SUB#> |
INV-<####-SUB#> |
INV-0019-SUB# |
21 | INV-<####-SUB#SUB> |
INV-<####-SUB#SUB> |
INV-0021-SUB#SUB |
24 | INV-<SUB>####> |
INV-<SUB>####> |
INV-SUB>0024 |
25 | INV-<####<SUB> |
INV-<####<SUB> |
INV-0025<SUB |
I also fixed missing escaping when template was not recognized.
I forgot the following case:
INV-<<##########>> INV-<0000008134>
It seemed to work with your intermediate version. Hope it is still working.
INV-<<##########>>
Still working with commits I pushed.
OK, let's move ahead. Do I have to do anything for the merge?
Prefixing inventory numbers by some text was removed in version 2.6. People trying to migrate from GLPI 9.5 to GLPI 10 will create text strings instead of real inventory numbers. The proposed modification reenables the previous feature...