Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How to use a value instead of a string in regular expression?

Reply
Thread Tools

How to use a value instead of a string in regular expression?

 
 
mrz2003
Guest
Posts: n/a
 
      08-17-2005
For example, if $aaa=="1.1", then by using
"$aaa =~ s/(\d+)$/($1)+1/;"
I want to change $aaa to "1.2".
Of couse, the regular expression is not correct.
Thanks!

 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      08-17-2005
mrz2003 wrote:
> For example, if $aaa=="1.1", then by using
> "$aaa =~ s/(\d+)$/($1)+1/;"
> I want to change $aaa to "1.2".


Add the /e modifier.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Howto identify a string value vs. a numeric value in std::string frohlinger@gmail.com C++ 9 09-19-2007 09:34 AM
How to use python regular expression to substitute string value Allerdyce.John@gmail.com Python 7 02-26-2006 09:23 PM
check to see if value can be an integer instead of string nephish@xit.net Python 11 02-06-2006 05:04 PM
String.value and String.value.length doesn't works together in IE with JVM Wee Javascript 1 07-16-2003 12:32 PM



Advertisments