<TextInput value={initialMoney}
onChangeText={(x) => {
setInitialMoney(x.replace(/\B(?=(\d{3})+(?!\d))/g, '.'));
}}
/>
The above code will not work correctly.
Instead of displaying 214.124.124.124
It will display 2.1.4.1.2.4.1.2.4.123
There is nothing wrong with the Regular Expression, I tried the regex outside the TextInput, and it works perfectly. Can anyone help me with this?