Index Page
cspice_matchw
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 

Abstract
I/O
Examples
Particulars
Required Reading
Version
Index_Entries

Abstract


   CSPICE_MATCHW returns a boolean indicating whether a string is matched by 
   a template containing wild cards.  The pattern comparison is case-sensitive.

   For important details concerning this module's function, please refer to
   the CSPICE routine matchw_c.

I/O

   
   Given:
   
       string      the scalar string to test for a match against the input
                   template 'templ'
                   
       templ       the scalar string template to test for a match 
                   against the 'string; 'templ may contain wild 
                   cards
   
                   The routine ignores leading and trailing spaces in both
                   the 'string' and the 'templ'
   
       wstr        the wild string token used in the input template which
                   may represent from zero to any number of characters
   
       wchr        the wild string token used in the input template which
                   may represents exactly one character
   

Examples


   Any numerical results shown for this example may differ between
   platforms as the results depend on the SPICE kernels used as input
   and the machine specific arithmetic implementation.

   
      Example(1):
   
      ;;
      ;; Determine if a string has the form
      ;;
      ;;     'ABC' + a single character + 'E' + anything 'Z'
      ;;
      ;; where '%' indicates a single character wildcard
      ;; and '*' indicates the glob wildcard.
      ;;
      single_char = '%'
      glob_char   = '*'
      template    = 'ABC%E*Z'
   
      ;;
      ;; A match to the template. Note, the glob wildcard '*' matches
      ;; a null condition, in this case no characters between 'E' 
      ;; 'Z'.
      ;;
      string = 'ABCDEZ'
      match  = cspice_matchi(  string, template, glob_char, single_char )
   
      if( match ) then begin 
         print, "String " + string + " matches the template " + template
      endif else begin
         print, "String " + string + " does not match the template " + template
      endelse
   
   IDL outputs:
   
      String ABCDEZ matches the template ABC%E*Z
   
   
      Example(2):
   
      Using the above code example, but with a 'string' value:
   
      string = 'ABCEZ'
   
   IDL outputs:
   
      String ABCEZ does not match the template ABC%E*Z
   
   'ABCEZ' does not match since no character exists between
   'C' and 'E'. The single char match matches only on a single
    character.
   
   
      Example(3):
   
      Using the above code example, but with a 'string' value:
   
      string = 'ABC E12345Z'
   
   IDL outputs:
   
      String ABC E12345Z matches the template ABC%E*Z
   
   '%' matches on a space.
   
   
      Example(4):
   
       Using the above code example, but with a 'string' value:
   
      string = 'ABC E12345Z'
   
   IDL outputs:
   
      String ABC e12345Z does not match the template ABC%E*Z
   
   A match respects the case of the characters being matched.

Particulars


   None.

Required Reading


   ICY.REQ

Version


   -Icy Version 1.0.0, 16-JUN-2003, EDW (JPL)

Index_Entries

 
   match string against wildcard template 
   test whether a string matches a wildcard template 
 



Wed Apr  5 17:58:02 2017