Need help with reg. exp. across multiple lines 
Author Message
 Need help with reg. exp. across multiple lines

I have been trying for some time (without success) to get use regular
expressions to match a multiple line pattern.

I am trying to manipulate disktab to automatically generate entries that are
missing.

The input looks like this:

# comment
# comment
type|type|type:\
        :description:nt#11:ns#11:nc#1111:\
        :s0#1511808:b0#8192:f0#1024:\
        :se#512:rm#5400:

I have been trying to grab the preceding comment in a single block (but I can
do it a line at a time).

The biggest problem is grabbing from type|...\ to :rm#5400:

I have tried

m{^[\w(|)?]+:\\\s+}m

which grabs the first line. As soon as I add a colon, which should match

type|type|type:\
        :

the regular expression doesn't match.

I have tried various combinations of the s and m modifiers but nothing seems
to help.

I must be missing something very simple but it continues to elude me.

Any clues would be appreciated.

--
Eric



Mon, 28 Apr 1997 11:31:43 GMT  
 Need help with reg. exp. across multiple lines

:I have been trying for some time (without success) to get use regular
:expressions to match a multiple line pattern.
:
:I am trying to manipulate disktab to automatically generate entries that are
:missing.

...

:I must be missing something very simple but it continues to elude me.
:
:Any clues would be appreciated.

Try using the supplied perl termcap libraries.

--tom
--

If you want your program to be readable, consider supplying the argument.
            --Larry Wall in the perl man page



Mon, 28 Apr 1997 20:38:27 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Please help re: reg exp from command line...

2. NEED HELP IN CREATING REG EXP

3. NEED HELP IN CREATING REG EXP

4. Regex problem: Multiple matches across Multiple lines

5. multi-line reg exp deletion

6. Line Reg Exp

7. Need reg exp to kill leading whitespace

8. Pattern matching across multiple lines in a file

9. Greedy matching across multiples lines.

10. Question about regex across multiple lines

11. Counting across multiple lines?

12. s across multiple lines ?

 

 
Powered by phpBB® Forum Software