How do I write a regexp that will select 1.23 or -12.34 but not 1.2.3?
$a =~ s/(\-*\d+\.\d+)/foo\1bar/g;
This always selects 1.2 out of 1.2.3, and it should not. I.e., "foo1.2bar. 3" is an error.
Thanks!
User Profile
Collapse
-
[newbie] regexp question
-
Yes indeed! Thank you!
d -
how to capture output from a system call and pipe into running script?
How to I capture stdout output from a system call and pipe it back into my running script?
system "echo foobar";
# how to continue here with "foobar" in stdin ??
...
I can fake it with pipes and additional scripts, but that seems like overkill.
Thanks.
(Yes, I'm STILL a newbie!)
dave
No activity results to display
Show More
Leave a comment: