substring

Discussion in 'Perl Misc' started by Alexandre Jaquet, Nov 24, 2003.

  1. Hi,

    I'm new to perl and I want to extract a substring from a response :

    I wanna to extract the part between pseudoinscrite= and " I've try
    something like that but don't know how to do :

    if ($resp->content =~/pseudoinscrite=(.+)"/) {
    // affect to $user the value

    Thanks for your help.
    Alexandre Jaquet, Nov 24, 2003
    #1
    1. Advertising

  2. Alexandre Jaquet

    Bigus Guest

    "Alexandre Jaquet" <> wrote in message
    news:3fc24122$0$3220$...
    > Hi,
    >
    > I'm new to perl and I want to extract a substring from a response :
    >
    > I wanna to extract the part between pseudoinscrite= and " I've try
    > something like that but don't know how to do :
    >
    > if ($resp->content =~/pseudoinscrite=(.+)"/) {
    > // affect to $user the value


    Something like:

    ($extracted) = $resp->content =~ /pseudoinscrite=(.+?)\"/;
    or
    ($extracted) = $resp->content =~ /pseudoinscrite=([^\"]+)/;

    should do it.

    Bigus
    Bigus, Nov 24, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Sm9u?=

    web sddress substring

    =?Utf-8?B?Sm9u?=, Nov 30, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    357
    Karl Seguin
    Nov 30, 2004
  2. juli
    Replies:
    3
    Views:
    8,840
    Shiva
    Dec 6, 2004
  3. Badass Scotsman

    Finding a SubString within a String

    Badass Scotsman, Mar 31, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    6,098
    S. Justin Gengo
    Mar 31, 2006
  4. Sean
    Replies:
    0
    Views:
    326
  5. Replies:
    3
    Views:
    181
    Sherm Pendley
    Aug 3, 2005
Loading...

Share This Page