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

Re: How do I match a string that is NOT at the end of a line?

by hippo (Bishop)
on Jun 29, 2015 at 08:52 UTC ( [id://1132432]=note: print w/replies, xml ) Need Help??


in reply to How do I match a string that is NOT at the end of a line?

Use the dot metacharacter. eg:

use strict; use warnings; use Test::More tests => 2; ok ("bar foo" =~ /foo/, 'Foo matched at end'); ok ("bar foo" !~ /foo./, 'Foo not matched at end');

Replies are listed 'Best First'.
Re^2: How do I match a string that is NOT at the end of a line?
by Anonymous Monk on Jun 29, 2015 at 13:20 UTC
    Thereby looking for: foo followed by any single character. Ergo, a foo that is not at the end of the line. Q.E.D.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-18 13:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found