Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

regex in print statement

Status
Not open for further replies.

AMiSM

Technical User
Joined
Jan 26, 2006
Messages
128
Location
US

Hi, guys!
I was just wondering, is it possible to use a regex in a print statement? Something like this:

print ( /\n{15}done./ );
 
what you have would probably print 1 (one) to indicate a true match if the match was true for $_

But what do you want to print or expect to print? Can you post some more code?
 

What kind of shorthand will allow one to print a prescribed number of something, requiring only one copy of that something in the statement?
 
Code:
print "\n" x 15, "done.";
 

excellent!
 
>> What kind of shorthand will allow one to print a prescribed number of something, requiring only one copy of that something in the statement?

Ahh, thats what you were getting at. :)
 

Well, it seemed at first glance that regex's would be useful for some kind of formatted output, but I guess they come at things from the opposite direction; not knowing exactly vs knowing precisely.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top