Community

Connect with us and enhance your M-Files experience using Unitfly Toolkit for M-Files. Here’s how to get started.

Notifications
Clear all

[Solved] Extended Auto Properties: How to use RegEx to make 12345.56 to 12'234.56 adding the ' after every third Number

0
Topic starter

Hi

I tried to use <<REGEX('<input>','(?<=\d)(?=(\d{3})+(?!\d))','idx'>> with a floating number (money, 2 digits), not a integer. I also tried (?<=\d)(?=(\d{3})+\b) but this is also not working.

How to use the REGEX functionality in the Extended Auto Properties

Regards

Daniel

1 Answer
0

Hi @daniel-mislovic,

 

In the expression parser you provided there is a ")" missing at the end, as well as a number for the "idx" - <<REGEX('<input>','(?<=\d)(?=(\d{3})+(?!\d))','0')>>.

The rights syntax would be: <<REGEX('input', 'pattern', 'match-idx', 'group-idx')>>

Where:

  • input - string to use REGEX on
  • pattern - your regex pattern
  • match-idx - zero based index of matched result to return
  •  

If match-idx and group-idx are empty, they are set to 0 as default.

Please note that single quotation mark is required.

 

Regarding the use case for adding the ' after every third number - currently only possible solution would be to write a regex that groups the number into group of 3 and saves each group into separate properties (PD.Group1, PD.Group2). You can then use CONCAT function (Auto Properties or Property Operations module) and merge those properties with separator '.

I have created a ticket for our DEV team for a new function for regex that would allow adding separators between groups easier (without new properties).

Answer

WATCH THE WEBINAR

Introducing AI Document Kit: Add-on for AI-driven Document Management