pattern match for 'string: 
Author Message
 pattern match for 'string:

Suppose a program in fortran:

      PROGRAM EXAMPLE
C
      INTEGER   ....
      REAL      ....
      CHARACTER ....
C
      INCLUDE    'XXX:FILENAME.INC'
C
      ...

      OPEN(UNIT=LUN,FILE='YYY:FILENAME.DAT',STATUS='UNKNOWN',
     +        ACCESS='INDEXED')

      ...

      END

How I get string XXX and YYY with perl?
     (XXX,YYY == [a-zA-Z0-9_$])

i.e. I search pattern matching for structure: 'string:  and get "string"
                                              --------
                                              ^      ^
                                              |      | end with :
                                              | start with '

     or string == [a-zA-Z0-9_$], example:  string = MNU$DIR_SRC

Thank you,

Gilles Ratel

                                              send mail at this address
Institut de recherche d'Hydro-Quebec
1800, Montee Sainte-Julie
Varennes, QC
CANADA   J3X 1S1



Fri, 01 Jul 1994 00:01:09 GMT  
 pattern match for 'string:

how about:

        string =~ /'(.*):/ ;

--
Ludhi Sidikpramana          |  You're not drunk | Phone: (914) 945 - 6300
Philips Laboratories        |  if you can lie   | Fax  : (914) 945 - 6375
345 Scarborough Road        |  on the floor w/o | Email: {uunet!philabs!lxs} or

--
Ludhi Sidikpramana          |  You're not drunk | Phone: (914) 945 - 6300
Philips Laboratories        |  if you can lie   | Fax  : (914) 945 - 6375
345 Scarborough Road        |  on the floor w/o | Email: {uunet!philabs!lxs} or



Sun, 03 Jul 1994 06:25:57 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Pattern Match - substitute a string after the match

2. pattern matching with non-existence of a string

3. pattern matching with a string variable?

4. pattern matching with string variable?

5. Help on pattern matching, string size

6. pattern matching in multi-line strings fails under perl4.034

7. pattern matching; see content file as one string

8. pattern matching starting at end of string

9. PERLFUNC: m// - match a string with a regular expression pattern

10. PERLFUNC: m// - match a string with a regular expression pattern

11. Reposting - Pattern match in an array of strings

12. Pattern Matching in array of strings

 

 
Powered by phpBB® Forum Software