CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions:
Regex Help for Search and replace

 



hydpm
User

Sep 5, 2008, 1:01 PM

Post #1 of 2 (2151 views)
Regex Help for Search and replace Can't Post

Need the Regular Expression for the below stuff:

$input Variable may have one of the followng:

$input = '1 h' ; $input = '2 h'; etc.

We need to search and repalce as follow:
  • if the $input= '1 h' ; then it should be converted to "1 hour"
  • If the $input ='2 h'; then it shoulf be converted to "2 hours"


The difference is when it is other than 1 then the h will be converted to hours a plural . if it '1 h' then h will be converted to '1 hour'.



Thanks,

Raj


KevinR
Veteran


Sep 5, 2008, 1:08 PM

Post #2 of 2 (2147 views)
Re: [wingsof5r] Regex Help for Search and replace [In reply to] Can't Post

answered in other thread
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives