Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
OK, with more data it looks like you want to capture everything after " - " up to "</title>". So...
while (<DATA>) { print "/", m{ - (.*?)\s*</title>}, "/\n"; } __DATA__ <title>GRP -134 - Grinding And Cutting Solution (ACME PR50 - Water Typ +e) </title> <title> GRP-123-1 - Grinding And Cutting Solution (Quakeroat 2780 UTC +- Synthetic Type)</title> <title> GRP-124 - Alkaline Rust Remover Solution</title> <title> GRP-124-1 - Alkaline Rust Remover Solution (Ardvark 185 - Rust + Remover)</title> <title> GRP-124-2 - Alkaline Rust Remover Solution (Ardvark 185L - Rus +t Remover)</title> <title> GRP-124-3 - Alkaline Rust Remover Solution (Bee-Dee J84AL - Ru +st Remover)</title> <title> GRP-124-4 - Alkaline Rust Remover Solution (Mag HD2-202 - Rust + Remover)</title> <title> GRP-124-5 - Alkaline Rust Remover Solution (Turk 4181L - Rust +Remover)</title> <title> GRP-124-6 - Alkaline Rust Remover Solution (Turk 4181 - Rust R +emover)</title> <title> GRP-124-7 - Alkaline Rust Remover Solution (Bee-Dee J84A - Rus +t Remover)</title> <title> GRP-124-8 - Alkaline Rust Remover Solution (Cadilac HTP-1150 - + Rust Remover)</title> <title> GRP-124-9 - Alkaline Rust Remover Solution (Cadilac HTP-1150L +- Rust Remover)</title> <title> GRP-124-10 - Alkaline Rust Remover (Titanium Long Soak)";

Output:

/usr/bin/perl -w /home/bri/git/cvsid/pm /Grinding And Cutting Solution (ACME PR50 - Water Type)/ /Grinding And Cutting Solution (Quakeroat 2780 UTC - Synthetic Type)/ /Alkaline Rust Remover Solution/ /Alkaline Rust Remover Solution (Ardvark 185 - Rust Remover)/ /Alkaline Rust Remover Solution (Ardvark 185L - Rust Remover)/ /Alkaline Rust Remover Solution (Bee-Dee J84AL - Rust Remover)/ /Alkaline Rust Remover Solution (Mag HD2-202 - Rust Remover)/ /Alkaline Rust Remover Solution (Turk 4181L - Rust Remover)/ /Alkaline Rust Remover Solution (Turk 4181 - Rust Remover)/ /Alkaline Rust Remover Solution (Bee-Dee J84A - Rust Remover)/ /Alkaline Rust Remover Solution (Cadilac HTP-1150 - Rust Remover)/ /Alkaline Rust Remover Solution (Cadilac HTP-1150L - Rust Remover)/ //

The empty last match is due yo what I hope is copy-paste error in the data you posted


Unless I state otherwise, all my code runs with strict and warnings

In reply to Re^3: Regex only returning partial data by FunkyMonk
in thread Regex only returning partial data by Grey Fox

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-18 07:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found