isalphaのヘルプ・マニュアル
日本語 英語
isalpha --help
man isalpha
ISALPHA(3) Linux Programmer’s Manual ISALPHA(3)
名前
isalnum, isalpha, isascii, isblank, iscntrl, isdigit, isgraph, islower,
isprint, ispunct, isspace, isupper, isxdigit - 文字を分類する
書式
#include
int isalnum(int c);
int isalpha(int c);
int isascii(int c);
int isblank(int c);
int iscntrl(int c);
int isdigit(int c);
int isgraph(int c);
int islower(int c);
int isprint(int c);
int ispunct(int c);
int isspace(int c);
int isupper(int c);
int isxdigit(int c);
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
isascii(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
isblank(): _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; or cc -std=c99
説明
これらの関数は、現在のロケールに従って c を分類する。 c は unsigned
char か EOF でなければならない。
isalnum()
英字または数字であるかを調べる。 (isalpha(c) || isdigit(c)) と等
価である。
isalpha()
アルファベットかどうか調べる。標準の "C" ロケー ル で は (isup-
per(c) || islower(c)) と等価である。他のロケールでは、大文字でも
小文字でもない他の文字でも isalpha() が true を返すことがある。
isascii()
c が、ASCII文字セットに合致する 7ビットの unsigned char であるか
を調べる。
isblank()
空白文字 (スペースかタブ) であるかを調べる。
iscntrl()
制御文字かどうかを調べる。
isdigit()
数字 (0〜9) かどうかを調べる。
isgraph()
表示可能な文字かどうかを調べる。スペースは含まれない。
islower()
小文字かどうかを調べる。
isprint()
表示可能な文字かどうかを調べる。スペースも含まれる。
ispunct()
表示可能な文字かどうかを調べる。スペースと英数字は含まれない。
isspace()
空白文字かどうかを調べる。 "C" ロケールか "POSIX" ロケールでは、
空白文字とは、スペース、フォームフィード ('\f') 、改 行(newline)
('\n') 、復帰(carriage return) ('\r') 、水平タブ ('\t') 、垂直タ
ブ ('\v') である。
isupper()
小文字かどうかを調べる。
isxdigit()
16進数での数字かどうかを調べる。
0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F の文字であるかどうか
を調べることと等価である。
返り値
文 字 c が調べた文字の種類に合っていれば 0 以外を返す。そうでなければ 0
を返す。
準拠
C99, 4.3BSD. C89 では、これらの関数のうち isascii() と isblank() 以 外
の す べ て が 規定されている。 isascii() は BSD や SVr4 の拡張である。
isblank() は POSIX.1-2001 と C99 7.4.1.3 に準拠している。 POSIX.1-2008
は、 isascii() を廃止予定としている。ローカライズされたアプリケーション
では、移植性を確保しつつ、この関数を使用することはできない点に注意す る
こと。
注意
あ る文字がどの種類に入るかということは、現在のロケールに依存する。たと
えば、デフォルトの C ロケールでは isupper() は A のウムラウトを認識でき
ないので、それが大文字だということがわからない。
関連項目
iswalnum(3), iswalpha(3), iswblank(3), iswcntrl(3), iswdigit(3), isw-
graph(3), iswlower(3), iswprint(3), iswpunct(3), iswspace(3), iswup-
per(3), iswxdigit(3), setlocale(3), toascii(3), tolower(3), toupper(3),
ascii(7), locale(7)
GNU 2009-03-15 ISALPHA(3)
ISALPHA(3) Linux Programmer’s Manual ISALPHA(3)
NAME
isalnum, isalpha, isascii, isblank, iscntrl, isdigit, isgraph, islower,
isprint, ispunct, isspace, isupper, isxdigit - character classification
routines
SYNOPSIS
#include
int isalnum(int c);
int isalpha(int c);
int isascii(int c);
int isblank(int c);
int iscntrl(int c);
int isdigit(int c);
int isgraph(int c);
int islower(int c);
int isprint(int c);
int ispunct(int c);
int isspace(int c);
int isupper(int c);
int isxdigit(int c);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
isascii(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
isblank(): _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; or cc -std=c99
DESCRIPTION
These functions check whether c, which must have the value of an
unsigned char or EOF, falls into a certain character class according to
the current locale.
isalnum()
checks for an alphanumeric character; it is equivalent to (isal-
pha(c) || isdigit(c)).
isalpha()
checks for an alphabetic character; in the standard "C" locale,
it is equivalent to (isupper(c) || islower(c)). In some
locales, there may be additional characters for which isalpha()
is true—letters which are neither upper case nor lower case.
isascii()
checks whether c is a 7-bit unsigned char value that fits into
the ASCII character set.
isblank()
checks for a blank character; that is, a space or a tab.
iscntrl()
checks for a control character.
isdigit()
checks for a digit (0 through 9).
isgraph()
checks for any printable character except space.
islower()
checks for a lower-case character.
isprint()
checks for any printable character including space.
ispunct()
checks for any printable character which is not a space or an
alphanumeric character.
isspace()
checks for white-space characters. In the "C" and "POSIX"
locales, these are: space, form-feed ('\f'), newline ('\n'),
carriage return ('\r'), horizontal tab ('\t'), and vertical tab
('\v').
isupper()
checks for an uppercase letter.
isxdigit()
checks for a hexadecimal digits, that is, one of
0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F.
RETURN VALUE
The values returned are non-zero if the character c falls into the
tested class, and a zero value if not.
CONFORMING TO
C99, 4.3BSD. C89 specifies all of these functions except isascii() and
isblank(). isascii() is a BSD extension and is also an SVr4 extension.
isblank() conforms to POSIX.1-2001 and C99 7.4.1.3. POSIX.1-2008 marks
isascii() as obsolete, noting that it cannot be used portably in a
localized application.
NOTES
The details of what characters belong into which class depend on the
current locale. For example, isupper() will not recognize an A-umlaut
(Ä) as an uppercase letter in the default C locale.
SEE ALSO
iswalnum(3), iswalpha(3), iswblank(3), iswcntrl(3), iswdigit(3), isw-
graph(3), iswlower(3), iswprint(3), iswpunct(3), iswspace(3), iswup-
per(3), iswxdigit(3), setlocale(3), toascii(3), tolower(3), toupper(3),
ascii(7), locale(7)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2009-03-15 ISALPHA(3)