Think about Loose Coupling | |
PerlMonks |
Re: RFC - Regular Expressions Tutorial, the Basics (for BEGINNERS)by Not_a_Number (Prior) |
on Jan 22, 2007 at 19:43 UTC ( [id://595976]=note: print w/replies, xml ) | Need Help?? |
If we wanted to match a single character, our pattern would be /a./. The control character is a '.' after the letter in question. No! /a./ means match two characters, an 'a' followed by any other character. To match a single lower-case 'a', the pattern is simply /a/ - try it and see:
Also, in your last paragraph, you've inverted your square brackets and slashes... Update: To clarify, the dot (period) is not a 'control character', as you seem to imagine, but a 'wildcard character'. To quote from perlretut (which I highly recommend you read, and include in your list of other sources): The period '.' matches any character but "\n"Update2: s/perlreftut/perlretut, sorry!
In Section
Meditations
|
|