Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: separating two sententences

by Anonymous Monk
on Sep 16, 2011 at 04:30 UTC ( [id://926304]=note: print w/replies, xml ) Need Help??


in reply to Re: separating two sententences
in thread separating two sententences

yes, you are right.i changed it to this but still nothing

#!/usr/bin/perl -w open IN,"<","file" or die "error opening file: $!"; while(<IN>){ if(/"\(\w+\)"\/){ print "$1\n"; }}

Replies are listed 'Best First'.
Re^3: separating two sententences
by AnomalousMonk (Archbishop) on Sep 16, 2011 at 04:45 UTC
    /"\(\w+\)"\/

    In this regex, the '(' and ')' (parenthesis) characters, which would normally be regex metacharacters marking the start and end of a capture group, are escaped by \ (backslash) characters that return them to being literal '(' and ')' characters. Again, see muba's analysis above Update: ...and reply below. (Missed that last \. Bad case of backslashitis.).

      Not to mention the backslash that escapes the forward slash that's supposed to mark the end of the regex. /...\/ should read /.../.

Re^3: separating two sententences
by Sinistral (Monsignor) on Sep 16, 2011 at 14:01 UTC

    You need to reread dreadpiratepeter's node again: Re^5: separating two sententences. Your input file just needs a split on the semicolon to get the two columns, then a regular expression to remove the quotes. Print those out separated by a comma or tab, and then Excel will read the file

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://926304]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-03-29 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found