On Fri, 29 Oct 2004 John W.Krahn wrote :
Prabahar Mosas wrote:
specimen coding ************** $value = 2422; $reg = '/\d/';
The slashes (/) are the delimiters for the match operator, theyare not a part of the regular expression, just like the quotes (') delimit the string but are not a part of it. Your "regular expression" says match a '/' character followed by a '\d' character followed by a '/' character.
> > I agree your point. But that is simple regular expression. > When I assign complex regular expressions into a variable it won't > assign. > > eg $regex = 's/[A-Z]/[a-z]/g';
That is matching every *single* character in the range A-Z and replacing *each* *character* with the *string* '[a-z]'.
> $regex = 's/\r//g';
> $regex = '/(^[^a-z])|/|(\.\.)/i'
> For this case What I need to do for that Mail me. Because this Problem is > one of the barrier in my project.
It looks like you may be confused between a regular expression, which is similar to a string, and the match, substitution and transliteration operators, two of which use regular expressions. Have you read some of the documentation on regular expressions and strings?
perldoc perlrequick perldoc perlretut perldoc perlre perldoc perlop perldoc perlreref
If you still think you need to do the above then:
perldoc -q "How do I match a pattern that is supplied by the user" perldoc -f eval
John -- use Perl; program fulfillment
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>
