Chapter Contents

Previous

Next
CALL RXCHANGE

CALL RXCHANGE



Changes one or more substrings that match a pattern

Category: Character String Matching
Restriction: Use with the RXPARSE function


Syntax
Arguments
Details
Comparisons
Example
See Also

Syntax

CALL RXCHANGE (rx, times, old-string<, new-string>);

Arguments

rx
specifies a numeric value that is returned from the RXPARSE function.
Tip: The value of rx points to an expression that is parsed by RXPARSE. CALL RXCHANGE uses the expression to find and change a matching substring.

times
is a numeric value that specifies the maximum number of times to change matching substrings.
Restriction: Maximum value of times is 2,147,483,647.

old-string
specifies the character expression to be searched and changed as a result of the change operation.

new-string
is a character variable that contains the result of the change operation.


Details

If old-string is a character variable, new-string is optional. If new-string is omitted, old-string is changed in place.

If old-string is an expression that is not a character variable, you must specify new-string.


Comparisons

The regular expression (RX) functions and CALL routines work together to manipulate strings that match patterns. Use the RXPARSE function to parse a pattern you specify. Use the RXMATCH function and the CALL RXCHANGE and CALL RXSUBSTR routines to match or modify your data. Use the CALL RXFREE routine to free allocated space.


Example

See the RXPARSE function Example.

See Also

Functions and CALL routines:

CALL RXFREE
CALL RXSUBSTR
RXMATCH
RXPARSE


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.