티스토리 뷰
Regex.pm
package MixPerl::Regex;
use strict;
use namespace "System";
use PerlNET qw(AUTOCALL);
#Constructor
=for interface
[interface: pure]
static Regex();
=cut
#Methods
=for interface
static string Replace(str SourceString, str FindPattern, str ReplacePattern);
static string Replaceg(str SourceString, str FindPattern, str ReplacePattern);
static string Replacegi(str SourceString, str FindPattern, str ReplacePattern);
=cut
#Constructor
sub new
{
my $class = shift;
my $self = bless {}, $class;
return $self;
}
#Methods
sub Replace
{
my ($source, $find, $replace) = @_;
$source =~ s/$find/$replace/;
return $source;
}
sub Replaceg
{
my ($source, $find, $replace) = @_;
$source =~ s/$find/$replace/g;
return $source;
}
sub Replacegi
{
my ($source, $find, $replace) = @_;
$source =~ s/$find/$replace/gi;
return $source;
}
Program.cs
using System;
namespace TestConsole
{
class Program
{
static void Main(string[] args)
{
string line;
line = MixPerl.Regex.Replaceg("abcB", "b", "x");
Console.WriteLine(line);
line = MixPerl.Regex.Replacegi("abcB", "b", "x");
Console.WriteLine(line);
}
}
}
'Code > Study' 카테고리의 다른 글
[AutoHotkey] SetTimer & PostMessage (0) | 2010.04.18 |
---|---|
[Perl] Cocoa (pl pm sample) (0) | 2008.11.09 |
[PerlNET] CIty (Mix Perl & C#) (0) | 2008.11.09 |
[Perl] BeeConverter (Convert HTML Entity to Unicode Character) (0) | 2008.11.09 |
[C/C++ vs C#] static (1) (0) | 2008.07.16 |
- Total
- Today
- Yesterday
- download.com
- Automation
- Microsoft
- AxWebBrowser
- Rollback Rx
- windows
- java
- DotNetMagic
- 애드센스숨기기
- iText
- c#
- iTextSharp
- Phalanger
- 스크린캡쳐
- AdSense감추기
- autohotkey
- 유틸리티
- registry
- jre
- Service pack
- AdSense숨기기
- tagREADYSTATE
- 애드센스감추기
- READYSTATE_COMPLETE
- Regular Expressions
- WinAutomation
- Sample Code
- ScreenHunter
- .net framework
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |