[RegExp] Why my re works like this?

M

Magicloud Wang

Dear,
I have text like below, and re is as below. The result is as below.
Why the first result do not have the line with number '1'? It should like:
["/dev/hda", "gpt", " 1 17.4kB 64.0MB 64.0MB ext3 boot
\n", " 2 64.0MB 8590MB 8526MB lvm \n"]

Thanks.

--- the result
["/dev/hda", "gpt", " 2 64.0MB 8590MB 8526MB lvm
\n"]
["/dev/mapper/vgroot-lvroot", "loop", " 1 0.00kB 7449MB 7449MB xfs
\n"]
["/dev/mapper/vgroot-lvswap0", "loop", " 1 0.00kB 1074MB 1074MB
linux-swap \n"]
---
--- re
/^Disk (.+?):.+
+
Partition Table: (.+?)

+
(.+
)*

/
---
--- text

Disk /dev/hda: 8590MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 17.4kB 64.0MB 64.0MB ext3 boot
2 64.0MB 8590MB 8526MB lvm


Error: Unable to open /dev/hdb - unrecognised disk label.


Disk /dev/mapper/vgroot-lvroot: 7449MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number Start End Size File system Flags
1 0.00kB 7449MB 7449MB xfs



Disk /dev/mapper/vgroot-lvswap0: 1074MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number Start End Size File system Flags
1 0.00kB 1074MB 1074MB linux-swap


Information: Don't forget to update /etc/fstab, if necessary.

---
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,274
Messages
2,571,366
Members
48,056
Latest member
ElidaMarlo

Latest Threads

Top