#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    456
    Rep Power
    15

    regex to strip non-alpha numeric characters


    $address = "123 Something Blvd.";

    What regular expression can strip non-alpha numeric characters from $address so it would be:

    $address = "123SomethingBlvd"

    ??

    THANKS!
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,616
    Rep Power
    4247
    Code:
    $line = "This is a 123 test, with some funny characters like * & !. End of line.";
    $line =~ s/[^\w]//g;
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    456
    Rep Power
    15
    Thanks! That works perfectly!
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    1
    Rep Power
    0

    Thanks


    Thanks, here's bitcookie #8635 for you.

IMN logo majestic logo threadwatch logo seochat tools logo