IHYPRESS.NET
PERL
HOME | ASP | C | CSS | HTML | JAVASCRIPT | PERL | PHP | PYTHON | RUBY | SVG
Perl ❯ Regular Expressions
<14>
#!/usr/bin/perl -wT use CGI ':standard'; use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use strict; 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();
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 IHYPRESS.NET. A DIVISION OF IHY PRESS. ALL RIGHTS RESERVED.