Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Match last word in a sentence

by parv (Vicar)
on Aug 14, 2021 at 01:39 UTC ( #11135835=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $list = "This is my list";
    $list =~ m/^(.+?)   # The 'rest' (Everything before last word)
                (\w+)   # Last 'word' (string of contiguous word character
    +s)
                \W*$    # Possible non-word characters at end of string
              /x;
    
  2. or download this
    $word_re = qr{ (?: & | -? [a-zA-Z]+ [a-zA-Z-]* ) }x;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2022-01-29 12:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (74 votes). Check out past polls.

    Notices?