IHYPRESS PROGRAMMING
Tutorials and Perl programs with code and output for beginners
Perl logo
HOME | ASP | C | CSS | GNUPLOT | HTML | JAVASCRIPT | PERL | PHP | PYTHON | RUBY | SVG
Perl ❯ Regular Expressions
<14>
#!/usr/bin/perl -wT use CGI':standard'; use CGI::Carp qw(warningsToBrowser fatalsToBrowser); print header(); print start_html(-title => "Regular Expressions"); my $string; $string = "Get your kicks on Route 66!"; if($string =~ m/(\d)/) { print "The first digit in the sentence is $1.<br>";} if($string =~ m/(\d+)/) { print "The first number in the sentence is $1.<br>";} if($string =~ m/kicks(.*)6/) { print "$1<br>";} if($string =~ m/kicks(.*?)6/) { print "$1<br>";} print end_html();
Hergestellt in Deutschland / Made in Germany
Regular Expressions The first digit in the sentence is 6.
The first number in the sentence is 66.
on Route 6
on Route
COPYRIGHT © 2015-2024 IHY PRESS Frankfurt am Main 60329 Deutschland