Quantcast
Channel: How to replace special characters to underscore(_) perl - Stack Overflow
Browsing latest articles
Browse All 2 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 latest articles
Browse All 2 View Live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>