home > 比較編 > Perl, PHP, Python, Ruby > regular expresions >

ForNext

Only Do What Only You Can Do

069. match test

VBScript

JScript

Perl

if ($s =~ /1999/) {
  print "party!\n";
}

PHP

if (preg_match('/1999/', $s)) {
  echo "party!\n";
}

Python

if re.search('1999', s):
  print('party!')

Ruby

if /1999/.match(s)
  puts "party!"
end

PowerShell

Scala

F#

C

C++

C++Builder

VC++

C#

Java

Objective-C

D

VB

VB.NET

Delphi

Ada

PL/SQL

T-SQL

関数型

inserted by FC2 system