Issue
“With clarity and definition is associated *"id"='o123-3923-d2i71-0129p' ,a certain physical spareness. Most of the "id"='s0987-3923-d2i71-0129p' great deciduous trees of England give one the impression, at any rate in summer, of being rather o "id"='p4523-3923-d2i71-0129p' ,bese. In Scandinavian mythology Embla, the elm, was the first woman. Those who have lived "id"='o123-3923-d2i71-0129p' ,much with old elm trees—and I spent a good part of my boyhood under their ponderous shade—will "id"='m0962-3923-d2i71-0129p' ,agree that the Scandinavians were men of insight. There is in effect something blowsily female about those vast trees that brood with all their bulging masses of foliage above the meadows of "id"='o123-3923-d2i71-0129p' ,the home counties.
Here I want to get only id. Output:
"id"='o123-3923-d2i71-0129p' "id"='s0987-3923-d2i71-0129p' "id"='p4523-3923-d2i71-0129p' "id"='o123-3923-d2i71-0129p'"id"='m0962-3923-d2i71-0129p'"id"='o123-3923-d2i71-0129p'
Solution
Try this:
#! /bin/bash
exec <<EOF
“With clarity and definition is associated *"id"='o123-3923-d2i71-0129p' ,a certain physical spareness. Most of the "id"='s0987-3923-d2i71-0129p' great deciduous trees of England give one the impression, at any rate in summer, of being rather o "id"='p4523-3923-d2i71-0129p' ,bese. In Scandinavian mythology Embla, the elm, was the first woman. Those who have lived "id"='o123-3923-d2i71-0129p' ,much with old elm trees—and I spent a good part of my boyhood under their ponderous shade—will "id"='m0962-3923-d2i71-0129p' ,agree that the Scandinavians were men of insight. There is in effect something blowsily female about those vast trees that brood with all their bulging masses of foliage above the meadows of "id"='o123-3923-d2i71-0129p' ,the home counties.
EOF
grep -oP '"id"='\''\w{4,5}-\w{4}-\w{5}-\w{5}'\'
Btw: Lorem ipsum is a good way to generate random text data, which gets easily understood by everyone. There are many online generators available.
Answered By - ceving Answer Checked By - Terry (WPSolving Volunteer)