سلام بر برنامه نویسان عزیز ایران زمین 😉 در این مطلب کد Regex : تشخیص شروع شدن با حرف s و پایان یافتن با حرف e در سی شارپ #C را آماده کردم. امیدوارم که این کد برای شما مفید باشد.
خروجی پروژه:
Matching words that start with 's' and end with 'e'
using the following regular expression: \bs\S*e\b
she
using the following regular expression: \bs\S*e\b
she
کد Regex : تشخیص شروع شدن با حرف s و پایان یافتن با حرف e در سی شارپ #C :
using System;
using System.Text.RegularExpressions;
class MainClass {
private static void DisplayMatches(string text,string regularExpressionString) {
Console.WriteLine("using the following regular expression: " +regularExpressionString);
MatchCollection myMatchCollection = Regex.Matches(text, regularExpressionString);
foreach (Match myMatch in myMatchCollection) {
Console.WriteLine(myMatch);
using System.Text.RegularExpressions;
class MainClass {
private static void DisplayMatches(string text,string regularExpressionString) {
Console.WriteLine("using the following regular expression: " +regularExpressionString);
MatchCollection myMatchCollection = Regex.Matches(text, regularExpressionString);
foreach (Match myMatch in myMatchCollection) {
Console.WriteLine(myMatch);