Don't ask to ask, just ask | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi jithoosin,
It depends on which "?" you mean. The typical use of "?" in a regex is "zero or one" of the preceding thing.Of course, another way to say "zero or one", is "optional". So, for example, in "(?:\?.*)?", the final "?" means that "(?:\?.*)" is optional. The second "?" (in "\?") stands for a single "?" (since it's escaped with "\"). However, the first "?":  :"(?:...)" has a different meaning, which is that it turns off the "capture" that would usually happen with "(...)". You should read more about perl regular expressions to get the full scoop. s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/ In reply to Re: questions of a perl beginner on regex
by liverpole
|
|