Professional Web Applications Themes
  1. #1

    Default Matching String

    Hi again!

    Im saving some data of a configuration file in scalar var.

    My configuration file has something like this:

    mailaddr=mail1@yes.com
    replymailaddr=mail2@yes.com

    Im choosing them with a case statement:

    switch ($param) {
    case /mailaddr=/i { $envio_mail = $valor; }
    case /replymailaddr/i { $envio_reply = $valor; }
    }

    However Im finding a problem here, cause its stopping twice in replymailaddr.
    (I think that it sounds like mailaddr)

    So, how can I fix this?, that in each 'case statement' it will mix mailaddr
    with replymailaddr?

    Thanks!

    --
    Pablo Fischer Sandoval (pablo@pablo.com.mx)
    [url]http://www.pablo.com.mx[/url]
    [url]http://www.debianmexico.org[/url]
    GPG FingerTip: 3D49 4CB8 8951 F2CA 8131 AF7C D1B9 1FB9 6B11 810C
    Firma URL: [url]http://www.pablo.com.mx/firmagpg.txt[/url]
    Pablo Fischer Guest

  2. #2

    Default Re: [solved] Matching String

    Again.. Solved.. duh

    case /^mailaddr/i, just add a ^ before the matched string.

    thanks!
    El día Sunday 24 August 2003 5:00 a Pablo Fischer mandó el siguiente correo:
    > Hi again!
    >
    > Im saving some data of a configuration file in scalar var.
    >
    > My configuration file has something like this:
    >
    > mailaddr=mail1@yes.com
    > replymailaddr=mail2@yes.com
    >
    > Im choosing them with a case statement:
    >
    > switch ($param) {
    > case /mailaddr=/i { $envio_mail = $valor; }
    > case /replymailaddr/i { $envio_reply = $valor; }
    > }
    >
    > However Im finding a problem here, cause its stopping twice in
    > replymailaddr. (I think that it sounds like mailaddr)
    >
    > So, how can I fix this?, that in each 'case statement' it will mix mailaddr
    > with replymailaddr?
    >
    > Thanks!
    >
    > --
    > Pablo Fischer Sandoval (pablo@pablo.com.mx)
    > [url]http://www.pablo.com.mx[/url]
    > [url]http://www.debianmexico.org[/url]
    > GPG FingerTip: 3D49 4CB8 8951 F2CA 8131 AF7C D1B9 1FB9 6B11 810C
    > Firma URL: [url]http://www.pablo.com.mx/firmagpg.txt[/url]
    --
    Pablo Fischer Sandoval (pablo@pablo.com.mx)
    [url]http://www.pablo.com.mx[/url]
    [url]http://www.debianmexico.org[/url]
    GPG FingerTip: 3D49 4CB8 8951 F2CA 8131 AF7C D1B9 1FB9 6B11 810C
    Firma URL: [url]http://www.pablo.com.mx/firmagpg.txt[/url]
    Pablo Fischer Guest

Similar Threads

  1. Regex for matching a string not in a URL
    By webpointz in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: April 8th, 05:10 PM
  2. Reg. string matching using reg-exp
    By Balaji thoguluva in forum PERL Beginners
    Replies: 7
    Last Post: February 6th, 11:13 PM
  3. Pattern matching for xx-xx-xx string
    By jeff@nospam.com in forum PHP Development
    Replies: 7
    Last Post: January 19th, 06:38 PM
  4. string matching
    By kamal in forum PERL Miscellaneous
    Replies: 2
    Last Post: August 22nd, 01:01 PM
  5. String matching not working
    By Dave from Dublin in forum PERL Miscellaneous
    Replies: 2
    Last Post: June 30th, 10:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139