What is Regular Expressions in Php
Regular
Expressions
ð The use of
regular
expression
in
PHP helps
create
well-designed, powerful PHP
programs.
ð The concept
of regular expression is universally accepted by
programmers.
ð Programmers ignore
regular expressions,
which
create large gap
in
their programming skill.
ð PHP based
regular
expressions are very simple
to implement once
their concept is understood.
ð Regular expressions
started out as a feature of the UNIX shell.
ð They were designed to
make it easier to
find,
replace
and
work with strings.
ð Regular expressions have
been
used widely
in
many different parts
of UNIX based Operating
System.
What is Regular
Expression?
ð A regular expression is
a specially formatted pattern that can be used to
find instances
of one string within another.
ð Several programming languages including
Visual
Basic, PERL, Java
Script and PHP
support regular expressions.
ð In another
word regular expressions
are basically a
pattern definition
language used
to make complex and flexible string searches
possible.
ð Regular expressions
in PHP
are
similar to any
modern,
text editor‟s
find/replace
tools.
ð This functionality makes editing a text
file a whole lot easier.
ð Regular expressions
are used
to check e-mail addresses, phone numbers, pin
code, zip
code, website URL.
ð So programmers
are not
required to
develop
their own
complex
and lengthy programming
routine to
do above
Regular Expression
Engine
ð A Regular expressions
engine is
software that can process Regular expressions, like trying to
match a pattern within a given string.
ð Usually,
the
engine is
part of a larger application and the user does
not have access
to the engine directly.
ð Application
will invoke the engine whenever needed
making sure the right
Regular expressions is
applied to the right file.
ð Different
Regular
expressions engines
are not fully compatible with each
other.
ð There are a few common uses
of Regular expressions.
ð Perhaps
the
most useful is form validation. For
example,
Regular
expressions can be used
to check that can
email address entered into a
form use the correct
syntax.
ð They can also be used to
complete complex search and
replace operations within
a given
body of text.
ð It is not possible with PHP‟s standard
str_replace function.
What is Regular Expressions in Php
Reviewed by Unknown
on
11:15:00 PM
Rating:
No comments: