Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: capturing optional text with a regex

by toolic (Bishop)
on Mar 31, 2014 at 20:55 UTC ( [id://1080453]=note: print w/replies, xml ) Need Help??


in reply to capturing optional text with a regex

They both match for me on:
This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-li +nux-thread-multi

Code:

use warnings; use strict; while (<DATA>) { print if /\s([#]\S)(.*)/; } __DATA__ 123/; #< 456/; #< a comment

Output:

123/; #< 456/; #< a comment

Replies are listed 'Best First'.
Re^2: capturing optional text with a regex
by RonW (Parson) on Mar 31, 2014 at 21:05 UTC
    Thanks. Looking deeper in to my set up.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-23 23:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found