Quantcast
Channel: How to replace special characters to underscore(_) perl - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by Sobrique for How to replace special characters to underscore(_) perl

You can use \W to negate the \w character class, but the problem you've got is that \w doesn't match your non-ascii letters. So you need to do something like this instead:#!/usr/bin/env perluse...

View Article



How to replace special characters to underscore(_) perl

my @folder = ('s,c%','c__pp_p','Monday_øå_Tuesday, Wednesday','Monday & Tuesday','Monday_Tuesday___Wednesday');if ($folder =~ s/[^\w_*\-]/_/g ) { $folder =~ s/_+/_/g; print "$folder : Got %\n" ;...

View Article
Browsing all 2 articles
Browse latest View live




Latest Images