سلام بر برنامه نویسان عزیز ایران زمین 😉 در این مطلب آموزش Regex » تشخیص درستی پول (دلار) با \$\d+\.\d{2} در سی شارپ را آماده کردم. انشاالله که این کد براتون مفید باشه.
خروجی این کد به صورت زیر می باشد:
$0.99
True
$1099999.00
True
$10.25
True
$90,999.99
False
$1,990,999.99
False
$1,999999.99
False
True
$1099999.00
True
$10.25
True
$90,999.99
False
$1,990,999.99
False
$1,999999.99
False
کد Regex » تشخیص درستی پول (دلار) با \$\d+\.\d{2} در سی شارپ :
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Text.RegularExpressions;
using System.Reflection;
public class MainClass{
public static void Main(){
Regex moneyR = new Regex(@"\$\d+\.\d{2}");
string[] money = new string[] { "$0.99",
"$1099999.00",
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Text.RegularExpressions;
using System.Reflection;
public class MainClass{
public static void Main(){
Regex moneyR = new Regex(@"\$\d+\.\d{2}");
string[] money = new string[] { "$0.99",
"$1099999.00",