ApSIC Xbench Forum

Check for no thousand separators

Hello.

I am trying to create a check that will look for numbers with spaces, commas and dots as thousand separators in the source text and then check if those numbers found in the source have been left without separators in the target text.

So far I’ve developed this:

Source: “([1-9]{1}[0-9]{0,2})=1\,(([0-9]{3}\,?)+)=2|([1-9]{1}[0-9]{0,2})=3\.(([0-9]{3}\.?)+)=4|([1-9]{1}[0-9]{0,2})=5[:space:]](([0-9]{3}[:space:]?)+)=6|([1-9]{1}[0-9]{0,2})=7([0-9]{3}+)=8”
Target: “@1[\,\.[:space:]]@2|@3[\,\.[:space:]]@4|@5[\,\.[:space:]]@6|@7[\,\.[:space:]]@8

It seems to fulfill its purpose but for some reason it also looks up spaces, commas and periods without numbers neighboring them. Would anyone be able to determine why it looks for those spaces, commas and periods? Please remove the additional “]” bracket after “=5[:space]” — the text editor here goes crazy if I just leave “[:space:]”

Any help is much appreciated!
Robert

Hi Robert,

This search should fit your needs and find all those numbers with spaces, commas and dots as thousands separators in the source text that do not contain any separator in target.

Source term: "([1-9]{,3})=1[,\.[:space:]]?(([0-9]{3})+)=2"
Target term: -@1[,\.[:space:]]@2
PowerSearch: On.
Search Mode: Regular Expressions.

([1-9]{,3})=1 means up to 3 digits between 0 and 9.
[,.[:space:]]? means 0 or 1 instance of comma, dot or space.
(([0-9]{3},?)+)=2 means 3 digits between 0 and 9.

Please note that you are also searching numbers that do not contain any thousand separator in source.

Regards,

Oscar.

Thank you very much Oscar :slight_smile:

Regards,
Robert