Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: broken regex

by elwood (Initiate)
on Sep 15, 2006 at 12:54 UTC ( [id://573114]=note: print w/replies, xml ) Need Help??


in reply to Re: broken regex
in thread broken regex

sorry about the bad formatting, I'll try again
  foreach (@words) {
    $line =~ s/(%\d)$_(%\d)//g;
    print "$line\n";
    }

It was my understanding that (%\d) detected a word boundary (space, begining of line, end of line)

Replies are listed 'Best First'.
Re^3: broken regex
by hgolden (Pilgrim) on Sep 15, 2006 at 12:56 UTC
    That's why we're here. \b is the word boundary metacharacter. And thanks for the code tags! :)

    Hays

      doh! of course! something about not seeing the forest for the trees :-)
      thanks
Re^3: broken regex
by ikegami (Patriarch) on Sep 15, 2006 at 15:16 UTC

    sorry about the bad formatting, I'll try again

    On PerlMonks, put <c>..</c> tags around your code. It's like <pre>..</pre>, but it handles escaping special characters for your (such as &, <, >, [ and ]). It also wraps long lines while offering a link to download the unwrapped version.

      Whereas using <pre></pre> can completely foul things up with long lines!

      Welcome to the monastery, I hope you find the place as useful as I have over the years.

      jdtoronto

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-19 13:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found