10ec1 simple reg exp - Perl Programming
Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
simple reg exp

Posted by sivga (sivga), 14 April 2006
hi all

thi is my program

my output is

version
2.17.8.9

i need to match 2.17so if i use

while(<p>)

{

if (/[0-9]+\.[0-7][0-7]/) {


}

}

is not working

any help pls.

thanks

Posted by admin (Graham Ellis), 15 April 2006
Hi, Welcome.   You really need to put some sort of action in the if block - otherwise the code as posted will just go through the whole file that I presume you've already opened on a file handle called p, find the matching lines, and do nothing with them.



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2013: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho
0