Hi,
Please help me in finding out any good and quick ebook on Regular Expression on PERL .

Vinay

Dani AI

Generated

As asked for a quick Perl regex resource, the most practical path is: learn core regex concepts first, then apply Perl-specific operators and flags. As observed, core ideas transfer across languages; as noted, keep a concise language reference at hand while practising. Core topics to master: character classes, quantifiers, grouping/alternation, anchors, greedy vs non-greedy matching, and backreferences. Perl adds useful tools such as non-capturing groups, named captures, the substitution and match operators, the common flags (/g, /i, /m, /s, /x), and the ability to evaluate replacements.

A few compact patterns and idioms:

my $s = "User: Alice, Phone: 555-1212";
if ($s =~ /User:\s*(\w+),\s*Phone:\s*([0-9-]+)/) {
    my ($name, $phone) = ($1, $2);
}

# substitution example
$s =~ s/(\d{4})-(\d{2})-(\d{2})/$3-$2-$1/;

# greedy vs non-greedy
my $html = "<p>One</p><p>Two</p>";
$html =~ /<p>(.*)<\/p>/;   # greedy
$html =~ /<p>(.*?)<\/p>/;  # non-greedy

Practical tips and cautions: use /x to document complex patterns; use while ($text =~ /.../g) for global captures; avoid broad .* when a more specific class will do; atomic groups (?>...) can prevent catastrophic backtracking on tricky inputs; watch Unicode/encoding in real data; prefer named captures or small helper substitutions when patterns get hard to read. The fastest gains come from small, targeted exercises and iterative testing against realistic sample text.

Recommended Answers

All 2 Replies

Hi,
Please help me in finding out any good and quick ebook on Regular Expression on PERL .

Vinay

I'd recommend the RegExpressions book from O'Reilly, I'm sure they have it online somewhere or online with their Safari online suite. But learning regular expressions shouldn't have to pertain to Perl books, any book should help you use them in Perl, etc.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.