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

Re: Re-define Word Boundary?

by thelenm (Vicar)
on Nov 20, 2003 at 23:27 UTC ( #308753=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    (?:(?<=\w)(?=\W|\z)|(?:(?<=\W)|(?<=\A))(?=\w)
    
  2. or download this
    (?:(?<!\w)(?=\w)|(?<=\w)(?!\w))
    
  3. or download this
    (?:(?<![\w/-])(?=[\w/-])|(?<=[\w/-])(?![\w/-]))
    
  4. or download this
    my $w = '\w/-';
    my $b = "(?:(?<![$w])(?=[$w])|(?<=[$w])(?![$w]))";
    my @words = ($rec =~ /${b}[$w]+${b}/g);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://308753]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2018-07-20 22:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (441 votes). Check out past polls.

    Notices?