Hi all,
I was hoping some of you could cast your experienced eyes over this.
I'm trying to process some text as shown below:
graphics 0 1 graph3 CLAIMED INTERFACE Graphics ext_bus 0 2/0/1 c720 CLAIMED INTERFACE Built-in + SCSI disk 0 2/0/1.0.0 sdisk CLAIMED DEVICE HP +C2247M1 /dev/dsk/c0t0d0 /dev/rdsk/c0t0d0 disk 1 2/0/1.2.0 sdisk CLAIMED DEVICE TOSHIBA +CD-ROM XM-3401TA /dev/dsk/c0t2d0 /dev/rdsk/c0t2d0 disk 2 2/0/1.6.0 sdisk CLAIMED DEVICE SEAGATE +ST31200N /dev/dsk/c0t6d0 /dev/rdsk/c0t6d0 ctl 0 2/0/1.7.0 sctl CLAIMED DEVICE Initiato +r /dev/rscsi/c0t7d0 lan 0 2/0/2 lan2 CLAIMED INTERFACE Built-in + LAN /dev/diag/lan0 /dev/ether0 tty 0 2/0/4 asio0 CLAIMED INTERFACE Built-in + RS-232C /dev/diag/mux0 /dev/mux0 /dev/tty0p0 ext_bus 1 2/0/6 CentIf CLAIMED INTERFACE Built-in + Parallel Interface /dev/c1t0d0_lp audio 0 2/0/8 audio CLAIMED INTERFACE Built-in + Audio /dev/audio /dev/audioEL_0 /dev/audioLL +_0 /dev/audioBA /dev/audioEU /dev/audioLU + /dev/audioBA_0 /dev/audioEU_0 /dev/audioLU +_0 /dev/audioBL /dev/audioIA /dev/audioNA + /dev/audioBL_0 /dev/audioIA_0 /dev/audioNA +_0 /dev/audioBU /dev/audioIL /dev/audioNL + /dev/audioBU_0 /dev/audioIL_0 /dev/audioNL +_0 /dev/audioCtl /dev/audioIU /dev/audioNU + /dev/audioCtl_0 /dev/audioIU_0 /dev/audioNU +_0 /dev/audioEA /dev/audioLA /dev/audio_0 + /dev/audioEA_0 /dev/audioLA_0 /dev/audioEL /dev/audioLL pc 0 2/0/10 fdc CLAIMED INTERFACE Built-in + Floppy Drive ps2 0 2/0/11 ps2 CLAIMED
What I'm trying to do is split out each seperate device and its associated text into an array
On my journey to enlightenment, I've started to venture beyond the world of very simple regexps into slightly more involved versions, and reading through perlmonks I've seen mention of greedy regexps and I think I understand why they're a bad thing
I suspect that this regexp is a prime example of such a beast, but I was hoping for the views of more enlightened members of PM and any pointers on how the regexp could be improved if necessary
Edited: ~Tue Oct 1 16:07:42 2002 (GMT) by footpad: Replaced <pre> tags with <code> tags, per Consideration
In reply to A query on greedy regexps by sch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |