Regex / split without delimitter

hello i any idea to split/regex amount money ex : 4.500.0002.500.0001.000.000

i want to split to
4.500.000
2.500.000
1.000.000
is there any ways to make it dynamic ?

@Aldhyt_Wirangga1 Hello,

If it is always 7 digits amount and there are only two amounts; you can split the amount against characters. The first 7 would be the first amount and rest would be the second amount.

hey, if you want to make it dynamic, standardize a separator to know the both values, so we can know where to split, or if the amount will never change you can use the split

exam 4.500.000-2.500.000

its might be more or less than 7 digits amount.

@Aldhyt_Wirangga1 without any specific separator it would be difficult to make it dynamic.

2 Likes

what if, thre was separator between digits?

Hi @Aldhyt_Wirangga1

Welcome back to the forums :slightly_smiling_face:

As @AKM_Robinuzzaman said, we need a specific separator otherwise the pattern won’t be very strong/robust.

Can you tell us anymore about the text. Anything that is consistent will help. Like will “000” always be at the end? Will always be three digits?

Regex.Split will likely be possible if you have a solid delimiter.

Take a look at this post by @ppr to learn more!

Hopefully this helps :blush:

Cheers

Steve

Hi @Aldhyt_Wirangga1 ,

Could we receive some other sample texts where the number of digits vary?

Hi @Aldhyt_Wirangga1 ,

If we can make sure that always there will be 3 digits at the end .Then you can use the attached code for your problem statement.
image
SplittingWithoutDelimitter.zip (68.0 KB)

Thanks,
Sam

1 Like

it will be easier, for example this input : 4.500.000-2.500.000

no matters how much lengt the first or second number have, it will split those 2 values and save in differents variables

regards!

it has many risks, but give a try on following:
grafik
grafik

Another strategy could be to split 4digit sequences like:

2 Likes

yes we can make sure the thre always be 3 digits at the end, thank u sir i appreciate it so much

thanku for the answer sir

its really help full thank you

1 Like

Always happy to help @Aldhyt_Wirangga1
I’d appreciate it if you marked the answer as Solution so that others facing similar queries may benefit from it as well, and also so that we may close this thread.

Kind Regards,
Sam

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.