You need to sign in to do that
Don't have an account?

Need regular expression to allow $ % . and Numbers in text
Hi,
I need a regular expression for the below formats allowing in text box in validation rule.
$100
200$
25%
0.25
User can directly enter the amount in doller or decimal values lessthan 1 or percentage values lessthan 100 for the discount
Please provide an regular expression to allow above formats.
Thanks in advance!
I need a regular expression for the below formats allowing in text box in validation rule.
$100
200$
25%
0.25
User can directly enter the amount in doller or decimal values lessthan 1 or percentage values lessthan 100 for the discount
Please provide an regular expression to allow above formats.
Thanks in advance!
Greetings!
Please use the regular expression given below-
String regex = '^[0-9%$]+$'
Here ^ is the starting symbol and $ is the ending symbol.
If you find your Solution then mark this as the best answer.
Thank you!
Regards,
Suraj Tripathi
Thanks for response!
Now allowing both the %$ both at time I need restrict that too, need to allow below format only.
$100
200$
25%
0.25
I am trying to write like below, but not working. Can you plaese guide me.
OR(
NOT(REGEX(Discounts__c , "^[0-9$]+$")),
NOT(REGEX(Discounts__c , "^[0-9%]+$")),
NOT(REGEX(Discounts__c , "^[0-9]+$")),
)
Thanks