RegEx [حل شد]
برای پیداکردن اعداد بین 0 تا 9999 ?
خیلی خیلی صورت سوال ناقص هست ...
ولی با فرض اینکه شما یک عبارت منظم برای پیدا کردن اعداد بین 0 - 9999 رو میخواید، من این عبارت منظم رو با یک متن نمونه براتون نوشتم، که البته شرطش اینه که بعد و قبل اعداد یک space وجود داشته باشه:
\s(\d\d?\d?\d?)\s
این هم متن نمونه که من روی اون تست رو انجام دادم:
Lorem Ipsum is simply dummy text of the printing and typesetting 11 industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500 when an unknown printer took a galley of type and scrambled 0 it to 1995 make a type specimen book. It has survived not only 25449 five centuries, but also the leap into electronic 354 typesetting, remaining essentially unchanged. It 194 was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum 2 passages, and more 419 recently with desktop publishing software like 419 Aldus PageMaker including versions of Lorem Ipsum.
جواب :
1- "^([0-9]|[0-9][0-9]|[0-9][0-9][0-9]|[0-9][0-9][0-9][0-9])"
2- "^(\\d\\d?\\d?\\d?)$"
از این سایت استفاده کردم سایت جالبی بود
پاسخگویی و مشاهده پاسخ های این سوال تنها برای اعضای ویژه سایت امکان پذیر است .
چنانچه تمایل دارید به همه بخش ها دسترسی داشته باشید میتوانید از این بخش لایسنس این آموزش را خریداری نمایید .