سلام بر تمامی برنامه نویسان سی شارپ 😉 در این پست کد Regex : پیدا کردن کلمه ای که حرف u دارد در سی شارپ #C را آماده کردم. انشاالله که این کد براتون مفید باشه.
خروجی این کد به این صورت است:
Matching words that contain 'u'
using the following regular expression: \S*u+\S*
put
public
using the following regular expression: \S*u+\S*
put
public
کد Regex : پیدا کردن کلمه ای که حرف u دارد در سی شارپ #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);