-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>>>>> "Gowtham" == Gowthaman R <Gowthaman> writes:

    Gowtham> hello list, is there any way in perl to find the position
    Gowtham> of the match in a string.

    Gowtham> when i use m// or s/// functions to locate a pattern in a
    Gowtham> lengthy string, can i get the information about the
    Gowtham> position of the occurance of match.

    Gowtham> if yes... is it posible to catch the positional
    Gowtham> information for multi occurance of hte same pattern in a
    Gowtham> string.

Probably many ways of doing it, one may be:

m/(.*)(matchre)(.*)(matchre)(.*)/

$1 will contain the first (unmatched) string, $2 the first match, $3
the next unmatched string, etc.

length will give you the lengths of the (un)matched strings.

Regards,

- -- Raju
- -- 
Raj Mathur                [EMAIL PROTECTED]      http://kandalaya.org/
       GPG: 78D4 FC67 367F 40E2 0DD5  0FEF C968 D0EF CC68 D17F
                      It is the mind that moves
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.6 and Gnu Privacy Guard <http://www.gnupg.org/>

iD8DBQE/8acpyWjQ78xo0X8RAiQXAJ97jE1/h1N9oYHBBeIZJhz3haBd/ACfbOKF
XWk84I2pAMN1VpcTWHRPwq4=
=XKOy
-----END PGP SIGNATURE-----


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to