سلام خدمت کاربران وب سایت پروگرم 98 😉 در این مطلب کد ساخت regex برای جستجوی IP address در سی شارپ #C را آماده کردم. انشاالله که این آموزش برای شما مفید باشد.
خروجی این کد به صورت زیر می باشد:
IP Address found at 0 with value of 192.168.1.192
کد ساخت regex برای جستجوی IP address در سی شارپ #C :
using System;
using System.Text.RegularExpressions;
public class MainClass
{
static void Main( string[] args ) {
string pattern = @"\d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?";
Regex regex = new Regex( pattern );
Match match = regex.Match( "192.168.1.192" );
while( match.Success ) {
using System.Text.RegularExpressions;
public class MainClass
{
static void Main( string[] args ) {
string pattern = @"\d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?";
Regex regex = new Regex( pattern );
Match match = regex.Match( "192.168.1.192" );
while( match.Success ) {