John W. Krahn wrote:
> Rob Dixon wrote:
>
>>Adriano Allora wrote:
>>
>>>$tex =~ s/^([^|]+).*/$1/o;
>>
>>Your regex is correct, but it doesn't do what you said you wanted! You're
>>substituting the entire string in $tex for just those characters up to
>>the first
>>pipe, but there's nothing
Rob Dixon wrote:
> Adriano Allora wrote:
>>
>> $tex =~ s/^([^|]+).*/$1/o;
>
> Your regex is correct, but it doesn't do what you said you wanted! You're
> substituting the entire string in $tex for just those characters up to
> the first
> pipe, but there's nothing in $tex - the data has be
On 09/23/2006 07:07 PM, Rob Dixon wrote:
[...]
If you want to do what you said, and put everything up to the pipe into a
variable (scalar $tex?) then
/([^|]+)/;
$tex = $1;
[...]
No, you should always only use the match variables after you've
determined that the match was successful:
/^(
Adriano Allora wrote:
>
> hi to all,
>
> another silly question about a pattern matching which should work but it
> doesn't.
>
> I have a list af string similar to this one:
>
> parola|n.c.,0,fem,sg,0|parola
>
> and I need to select all the chars before the pipe and put them in a
> variable.
>
Adriano Allora am Sunday, 24. September 2006 01:12:
> hi to all,
>
> another silly question about a pattern matching which should work but
> it doesn't.
>
> I have a list af string similar to this one:
>
> parola|n.c.,0,fem,sg,0|parola
>
> and I need to select all the chars before the pipe an
Adriano Allora wrote:
> hi to all,
Hello,
> another silly question about a pattern matching which should work but it
> doesn't.
>
> I have a list af string similar to this one:
>
> parola|n.c.,0,fem,sg,0|parola
>
> and I need to select all the chars before the pipe and put them in a
> vari