Develop and Download Open Source Software

View サンプルコード(char, std::stringを使用)

category(Tag) tree

file info

category(Tag)
サンプル
file name
sample-char-string
last update
2008-12-16 14:20
type
Plain Text
editor
しまたろ
description
文字型としてcharを、文字列としてstd::stringを使用しています。
language
Japanese
translate
////////////////////////////////////////////////////////////
// Sample: charとstd::stringを使用
#include <iostream>
#include \"mercury/regex.h\"

int main(void)
{
	const std::string pattern = \"(a|bc)*d*e\";
	const std::string text    = \"abcde\";

	const mercury::regex re(pattern);
	if(re.match(text))
	{
		std::cout << \"マッチしました\" << std::endl;
	}
	else
	{
		std::cout << \"マッチしませんでした\" << std::endl;
	}
	return 0;
}