smontsar has asked for the wisdom of the Perl Monks concerning the following question:
Is there some quick and dirty way to detect is a string is a pure string, or if it is a regular expression.
Given:
$a="a.*b"; $b="acdb";
I am looking for a technique or method such that (in pseudocode):
methodIsItRegEx($a) == TRUE methodIsItRegEx)$b) == FALSE
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Detecting if a string is a regular expression
by MidLifeXis (Monsignor) on Jan 10, 2013 at 19:45 UTC | |
Re: Detecting if a string is a regular expression
by davido (Cardinal) on Jan 10, 2013 at 19:48 UTC | |
Re: Detecting if a string is a regular expression
by LanX (Saint) on Jan 10, 2013 at 19:58 UTC | |
by AnomalousMonk (Archbishop) on Jan 10, 2013 at 23:40 UTC | |
by LanX (Saint) on Jan 11, 2013 at 00:06 UTC | |
Re: Detecting if a string is a regular expression
by BrowserUk (Patriarch) on Jan 11, 2013 at 00:29 UTC | |
by LanX (Saint) on Jan 12, 2013 at 11:03 UTC | |
Re: Detecting if a string is a regular expression
by Kenosis (Priest) on Jan 10, 2013 at 19:59 UTC |
Back to
Seekers of Perl Wisdom