Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: how to to find the "/" in a string

by pvaldes (Chaplain)
on Aug 31, 2012 at 18:30 UTC ( #991067=note: print w/ replies, xml ) Need Help??

in reply to how to to find the "/" in a string

Not sure if I'm understanding the problem. You can search for a special character putting a "\" before "my_special_character"

count=0, while ($html =~ [aug<\/td>]g) { $count++ }

Comment on Re: how to to find the "/" in a string
Download Code
Replies are listed 'Best First'.
Re^2: how to to find the "/" in a string
by AnomalousMonk (Canon) on Aug 31, 2012 at 19:01 UTC
    count=0, while ($html =~ [aug<\/td>]g) { $count++ }

    Please don't post code that won't work – or, in this case, even compile. (Or if the code is untested, please flag the fact prominently.) A beginning Perler, even one as reluctant as robertw to read basic documentation, deserves better of us.

    >perl -wMstrict -le "my $html = 'xxx aug</td> yyy aug</td> zzz'; ;; my $count = 0; while ($html =~ m[aug</td>]g) { $count++ } print $count; ;; my $count2 =()= $html =~ m{ aug</td> }xmsg; print $count2; " 2 2

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2015-11-28 13:03 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (741 votes), past polls