Note that there are some explanatory texts on larger screens.

plurals
  1. POPerl Pattern Matching Question
    primarykey
    data
    text
    <p>I am trying to match patterns in perl and need some help.</p> <p>I need to delete from a string anything that matches [xxxx] i.e. opening bracket-things inside it-first closing bracket that occurs. </p> <p>So I am trying to substitute with space the opening bracket, things inside, first closing bracket with the following code :</p> <pre><code> if($_ =~ /[/) { print "In here!\n"; $_ =~ s/[(.*?)]/ /ig; } </code></pre> <p>Similarly I need to match i.e. angular bracket-things inside it-first closing angular bracket.</p> <p>I am doing that using the following code :</p> <pre><code> if($_ =~ /&lt;/) { print "In here!\n"; $_ =~ s/&lt;(.*?)&gt;/ /ig; } </code></pre> <p>This some how does not seem to work. My sample data is as below :</p> <pre><code> 'Joanne' &lt;!--Her name does NOT contain "Kathleen"; see the section "Name"--&gt; "'Jo'" 'Rowling', OBE [http://news bbc co uk/1/hi/uk/793844 stm Caine heads birthday honours list] BBC News 17 June 2000 Retrieved 25 October 2000 , [http://content scholastic com/browse/contributor jsp?id=3578 JK Rowling Biography] Scholastic com Retrieved 20 October 2007 better known as 'J K Rowling' ,&lt;ref name=telegraph&gt;[http://www telegraph co uk/news/uknews/1531779/BBCs-secret-guide-to-avoid-tripping-over-your-tongue html Daily Telegraph, BBC's secret guide to avoid tripping over your tongue, 19 October 2006] is a British &lt;!--do not change to "English" or "Scottish" until issue is resolved --&gt; author best known as the creator of the [[Harry Potter]] fantasy series, the idea for which was conceived whilst on a train trip from Manchester to London in 1990 The Potter books have gained worldwide attention, won multiple awards, sold more than 400 million copies and been the basis for a popular series of films, in which Rowling had creative control serving as a producer in two of the seven installments [http://www businesswire com/news/home/20100920005538/en/Warner-Bros -Pictures-Worldwide-Satellite-Trailer-Debut%C2%A0Harry Business Wire - Warner Bros Pictures mentions J K Rowling as producer ] </code></pre> <p>Any help would be appreciated. Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload