Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Regular expressions

by BrowserUk (Patriarch)
on Oct 30, 2002 at 12:45 UTC ( [id://209042]=note: print w/replies, xml ) Need Help??


in reply to Regular expressions

If this is exactly and all you want then

my $str ='<html>/something/more words<br/></html>'; my @bits = $str =~ m!(<html>)/([^/]+)/([^/]+)<br/>(</html>)!; print $_,$/ for @bits;

Gives

<html> something more words </html>

Of course, if what you've asked for is a simplification of your real requirements, then there are probably much better ways of doing what you really want, but you'd need to tell us what that is.


Nah! Your thinking of Simon Templar, originally played by Roger Moore and later by Ian Ogilvy

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://209042]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2025-03-25 22:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (67 votes). Check out past polls.

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.