Charlotte Hee wrote:
On Fri, 30 Jul 2004, Bob Showalter wrote:
OK. Instead of using split, why not capture the tokens you're interested in.
Something like:
for my $w ($title =~ /([A-Za-z]+[^A-Za-z\s]*)\s*/g) {
Let me see if I understand this expression:
[snip]
\s*/g
This matches a blank space z
Charlotte Hee wrote:
> On Fri, 30 Jul 2004, Bob Showalter wrote:
> > for my $w ($title =~ /([A-Za-z]+[^A-Za-z\s]*)\s*/g) {
> >
>
> That's amazing! Yes, that works.
>
> Let me see if I understand this expression:
> /([A-Za-z]+
> This matches any letter, uppercase or lowercase, 1 or more times
On Fri, 30 Jul 2004, Bob Showalter wrote:
> Date: Fri, 30 Jul 2004 13:52:57 -0400
> From: Bob Showalter <[EMAIL PROTECTED]>
> To: 'Charlotte Hee' <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Subject: RE: problem with splitting on "words"
>
&g
Charlotte Hee wrote:
> Hi Bob,
>
> In one of my tests I added the '>' to the character class [^\w->] but
> I still didn't get 'B0->'.
I'm guessing it's because that looks like a range. Using [^\w\->] should
work.
> I've just learned about character classes
> so I am trying to get a better handl
;K- and I would consider 'B0->' a word and
'K-' another word.
thanks for the quick repy. Chee
On Fri, 30 Jul 2004, Bob Showalter wrote:
> Date: Fri, 30 Jul 2004 13:29:54 -0400
> From: Bob Showalter <[EMAIL PROTECTED]>
> To: 'Charlotte Hee
Charlotte Hee wrote:
> Hello All,
>
> I am having trouble splitting words from titles from a list of
> research papers. I thought I could split the title into words like so:
>
> #!/usr/local/bin/perl
> use locale;
>
> %forums = ( 1 => 'B0->K+K-Ks',
> 2 => 'B+->K+KsKs Decays',
Hello All,
I am having trouble splitting words from titles from a list of research
papers. I thought I could split the title into words like so:
#!/usr/local/bin/perl
use locale;
%forums = ( 1 => 'B0->K+K-Ks',
2 => 'B+->K+KsKs Decays',
3 => 'Measurement of the