Explain regular expression in perl?



Explain regular expression in perl?..

Answer / Devendra Dangwal

Regular expressions (regex) are sequences of characters that form a search pattern. They are used to match, search, and manipulate text in Perl. Some common regex elements include:

* ^ - matches the start of a line
* $ - matches the end of a line
* . - matches any single character except a newline
* [] - matches any character inside the brackets
* () - groups characters for reuse or priority
* | - matches either of the patterns on its left or right
* ?, +, * - quantifiers that specify how many times a pattern should match

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More CGI Perl Interview Questions

sort a word "system" in perl/shell without using built in functions output should be emssty

2 Answers   emc2,


my @array=('data1','data2'); my @array1=('data1','data2'); my ($i,$k); $i=7; $k=7; while($i){ $array [++$#array] = 'ree'; $i--; print "@array"; } while($k){ push(@array1,'ree'); $k--; print "@array1"; } Are these two while loop are doing the same functionality ? What may be the difference?

2 Answers  


Explain different types of perl operators.

1 Answers  


Is there any way to add two arrays together?

1 Answers  


Which functions in Perl allows you to include a module file or a module and what is the difference between them?

1 Answers  


Write a script for 'count the no.of digits using regular expressions in perl..

6 Answers   AppLabs,


In Perl we can show the warnings using some options in order to reduce or avoid the errors. What are that options?

1 Answers  


Explain the use of 'my' keyword in perl?

1 Answers  


What are perl variables?

1 Answers  


Why do we use "use strict" in perl?

1 Answers  


What is the use of -w, -t and strict in Perl?

1 Answers  


How to connect to SQL server through Perl?

0 Answers  


Categories