in reply to Re: Regular Expressions on Unicode
in thread Regular Expressions on Unicode
Thanks so much for your help!#!/usr/bin/perl #I want to take a file of text as input, split it into an array of wor +ds #then search through the array for a word that matches the regular #expression, printing all matches. binmode STDIN, ":decoding(UTF-8)"; binmode STDOUT, ":decoding (UTF-8)"; use utf8; use charnames ':full'; while ($line=<>){ @array = split(/ /, $line); foreach $x (@array){ if ($x=~ /\x{02c0}/){#glottal stop print "$x\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Regular Expressions on Unicode
by moritz (Cardinal) on Dec 14, 2009 at 19:19 UTC | |
|
Re^3: Regular Expressions on Unicode
by Anonymous Monk on Dec 14, 2009 at 15:09 UTC | |
by Anonymous Monk on Dec 14, 2009 at 15:20 UTC |