Hans Meier (John Doe) wrote:
> John W. Krahn am Dienstag, 7. März 2006 00.12:
>>Adam W wrote:
>>>JupiterHost.Net wrote:
>>$text =~ s!(.*?)\((.*?)\)!$1!g;
> [...]
Same exact regex as above:
$test =~ s{ (.*?) [(] (.*?) [)] }
{$1}xmsg;
> [...]
>>>Can you tell me w
John W. Krahn am Dienstag, 7. März 2006 00.12:
> Adam W wrote:
> > JupiterHost.Net wrote:
> $text =~ s!(.*?)\((.*?)\)!$1!g;
[...]
> >> Same exact regex as above:
> >>
> >> $test =~ s{ (.*?) [(] (.*?) [)] }
> >> {$1}xmsg;
[...]
> > Can you tell me what the function of the squar
JupiterHost.Net wrote:
>>
>>> And 'm' and 's' are ways of telling Perl how to interpret a line, right?
>>
>> The /m option defines what the ^ and $ anchors match but you aren't using
>> those anchors. The /s option defines what . matches so your regular
>> expression will match something different
$test =~ s{ (.*?) [(] (.*?) [)] }
{$1}xmsg;
Just a .02 via an FYI :)
That looks pretty cool. Using 'x' allows whitespace use, correct?
Correct.
And 'm' and 's' are ways of telling Perl how to interpret a line, right?
The /m option defines what the ^ and $ anchors match
Adam W wrote:
> JupiterHost.Net wrote:
>>
>>>
$text =~ s!(.*?)\((.*?)\)!$1!g;
>>>
>>>
>>> Thanks for the help and the more streamlined regexp.
>>
>>
>> An even better way (see O'reilley's "Perl Best Practices" by Damian
>> Conway - buy this book you will write better code)
>>
>> Is to make it
JupiterHost.Net wrote:
> Adam W wrote:
>> John W. Krahn wrote:
>>
>>> $text =~ s!(.*?)\((.*?)\)!$1!g;
>>
>>
>> Thanks for the help and the more streamlined regexp.
>
> An even better way (see O'reilley's "Perl Best Practices" by Damian
> Conway - buy this book you will write better code)
>
> Is t
JupiterHost.Net wrote:
$text =~ s!(.*?)\((.*?)\)!$1!g;
Thanks for the help and the more streamlined regexp.
An even better way (see O'reilley's "Perl Best Practices" by Damian
Conway - buy this book you will write better code)
Is to make it extremely readable with xms :)
Same exact
$text =~ s!(.*?)\((.*?)\)!$1!g;
Thanks for the help and the more streamlined regexp.
An even better way (see O'reilley's "Perl Best Practices" by Damian
Conway - buy this book you will write better code)
Is to make it extremely readable with xms :)
Same exact regex as above:
$test =~
John W. Krahn wrote:
Adam W wrote:
Here is an example of one of my regexps that produces this warning:
$text =~ s!(.*?)(\()(.*?)(\))!\1<\/a>!g;
BTW, why capture $2 and $4 if you are not using them and why is everything
backslashed?
Since I'm relatively new to the language, most of my reg
Adam W wrote:
> Hello All,
Hello,
> I'm using '-w' like any good hacker, but every time I try to use
> backreferences in my regexps, I get a warning "\1 better written as $1
> at"
>
> I'm confused because, according to perlretut:
> "Although $1 and \1 represent the same thing, care shoul
Hello All,
I'm using '-w' like any good hacker, but every time I try to use
backreferences in my regexps, I get a warning "\1 better written as $1
at"
I'm confused because, according to perlretut:
"Although $1 and \1 represent the same thing, care should be taken to
use matched variable
11 matches
Mail list logo