in reply to Irregular Expression??
How do I determine that the variable contains a ' in the value.There are many ways of doing so:
if ($a =~ /'/) {....} if (index ($a, "'") >= 0) {....} if (split ($a, "'", -1) >= 2) {....} if ($a =~ y/'/'/) {....}
how would I change the value in the variable toThat's not a clear question. First of all, "A\'\'Bcd" is the same string as "A''Bcd". Do you want backslashes in the resulting value? Second, do you want to change the first quote? The last quote? Quotes between "A" and "B"? All quotes? Only quotes in the second position?$a = "A\'\'Bcd"
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Irregular Expression??
by Red_Dragon (Beadle) on Feb 23, 2004 at 22:10 UTC | |
|
Re: Re: Irregular Expression??
by mutated (Monk) on Feb 23, 2004 at 22:35 UTC | |
by jbware (Chaplain) on Feb 23, 2004 at 23:02 UTC | |
by benrwebb (Scribe) on Feb 24, 2004 at 17:26 UTC |