Multiline regexps and line numbers 
Author Message
 Multiline regexps and line numbers

Is there a way in Perl 5 to find out on which line a multi line pattern
matched ? Is there a special variable for this ?

Thanks, -- KRis



Mon, 12 Jan 1998 03:00:00 GMT  
 Multiline regexps and line numbers

:
: Is there a way in Perl 5 to find out on which line a multi line pattern
: matched ? Is there a special variable for this ?

Try

    $line = $` =~ tr/\n//;

Larry



Thu, 15 Jan 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Counting number of chars in a line (part of reading multiline CSV

2. Multiline regexps with matches

3. removing blank lines in a multiline string?

4. Multiline pattern matching with command line invocation

5. Perl line numbers vs Apache error_log reported numbers?

6. How single-line switch (/s) works in regexps?

7. regexps with index(), regexps vs strings, clarify $*

8. Perl regexps compared to Python regexps

9. Randomly selecting lines by line number

10. displaying lines with a specific number of lines on each page

11. Searching a WORD 6 DOC by line line number

12. AutoSplit gets line numbers wrong?

 

 
Powered by phpBB® Forum Software