[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions , Volume 2


rpmatch Subroutine

Purpose

Determines whether the response to a question is affirmative or negative.

Library

Standard C Library (libc. a)

Syntax

#include <stdlib.h>


int rpmatch ( Response)
const char *Response;

Description

The rpmatch subroutine determines whether the expression in the Response parameter matches the affirmative or negative response specified by the LC_MESSAGES category in the current locale. Both expressions can be extended regular expressions.

Parameters


Response Specifies input entered in response to a question that requires an affirmative or negative reply.

Return Values

This subroutine returns a value of 1 if the expression in the Response parameter matches the locale's affirmative expression. It returns a value of 0 if the expression in the Response parameter matches the locale's negative expression. If neither expression matches the expression in the Response parameter, a -1 is returned.

Examples

The following example shows an affirmative expression in the En_US locale. This example matches any expression in the Response parameter that begins with a y or Y followed by zero or more alphabetic characters, or it matches the letter o followed by the letter k.

^[yY][:alpha:]* | ok

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

Related Information

The localeconv subroutine, nl_langinfo subroutine, regcomp (regcomp Subroutine) subroutine, regexec (regexec Subroutine) subroutine, setlocale (setlocale Subroutine) subroutine.

National Language Support Overview for Programming and Understanding Locale Subroutines in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.

Subroutines Overview in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]