Justino Berrun wrote:
> hello amigos
>
> how would i express some where before/first and some where
> after/later in a string for example, if (match this "-key" before
> this "5L" ){ do the rest... }
> on a string that look like so: $string="-key 3345 -door 3432 -5L";

Hello Justino.

I think I understand. You want to check that a string starts with
'-key' and ends with '-5L'. You'll need a regular expression with
these ingredients:

    ^ - matches only at the start of a string
    $ - matches only at the end of a string
    . - matches any character

putting these together within a regular expression 'match'
operation:

    m/^-key.*-5L$/

(the * lets the . match any number of characters)

You can test your string like this:

    if ($string =~ m/^-key.*-5L$/) {
        :
    }

Hope this helps,

Rob




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to