Re: Problem with STRSPLIT [message #8657] |
Thu, 10 April 1997 00:00 |
sritcey
Messages: 5 Registered: March 1997
|
Junior Member |
|
|
R. Kyle Justice (rkj@dukebar.crml.uab.edu) wrote:
: Has anyone noticed this strange behavior with PV-Wave's
: STRSPLIT function?
[snip]
: if I have 'abc.xyz' I am not able to split it
: using '.'
That's because '.' has special meaning in defining the delimiter pattern.
Note that the second input parameter to STRSPLIT is not a simple substring
but a "regular expression". The concept of regular expression is expanded
upon in some of the routines which them, but not this one. For a fuller
discussion see the documentation for STRMATCH.
One way to get what you want is to use
result = strsplit ('abc.xyz', '\.')
to "escape" the period (i.e., disable its special meaning to the regular
expression parsing engine).
(In my opinion the Wave documentation is deficient here in that the
example is far too simple, using ':' as the search pattern, and leading
the user to thing that pattern is limited to being a simple substring.)
Stephen Ritcey, MSc (902)494-3313 (voice) (902)494-5191 (fax)
Physics Dept., Dalhousie Univ., Halifax, N.S., Canada B3H 3J5
|
|
|