Hi,

Thanks for that, it's put me on the correct track, however when I run it inside a perl script using Starwberry Perl

#!/usr/bin/perl #use strict; use warnings; $str = "select Assigned, null, null, count(*) from wftask where Assign +ed in ('15000847','20005966','20005965','20004711','15120173','150004 +37','15023846','15022744','15062553','15149541','15000245','15000217' +,'15000803','15000636','15000690','15000437','15001069','15119338','1 +5022744','20009455','20001463','15179195','20008500','20004675','1500 +0988','15179195','15119270') and RefClass is not null and RefKey is n +ot null group by Assigned union select null, null, DistGroup, count(* +) from wftask where DistGroup in ('SLT','Budget Signatory/310','Budge +t Signatory/544','Budget Signatory/539','Budget Signatory/518','Budge +t Signatory/321','Budget Signatory/543','Budget Signatory/338','Budge +t Signatory/513','Budget Signatory/6','Budget Signatory/359','Budget +Signatory/358','Budget Signatory/530','Budget Signatory/300','Budget +Signatory/550','Budget Signatory/490','Budget Signatory/491','Budget +Signatory/376','Budget Signatory/377','Budget Signatory/401','Budget +Signatory/178','Budget Signatory/18','Budget Signatory/236','Budget S +ignatory/40','Budget Signatory/246','Budget Signatory/507','Budget Si +gnatory/475','Budget Signatory/464','Budget Signatory/459','Budget Si +gnatory/18','Budget Signatory/310','Budget Signatory/544','Budget Sig +natory/539','Budget Signatory/518','Budget Signatory/321','Budget Sig +natory/543','Budget Signatory/338','Budget Signatory/513','Budget Sig +natory/6','Budget Signatory/359','Budget Signatory/358','Budget Signa +tory/530','Budget Signatory/300','Budget Signatory/550','Budget Signa +tory/490','Budget Signatory/491','Budget Signatory/376','Budget Signa +tory/377','Budget Signatory/401','Budget Signatory/178','Budget Signa +tory/18','Budget Signatory/236','Budget Signatory/40','Budget Signato +ry/246','Budget Signatory/507','Budget Signatory/475','Budget Signato +ry/464','Budget Signatory/459','North Long Term Allocation','North Lo +ng Term Approvals','North Long Term Review','North Long Term Safeguar +ding','Placement Review','RAS Surgery','SLT Awaiting Allocation','SLT + Duty','SLT Duty Senior','SLT OT Equipment','SLT Pending','SLT Review +','SLT Single Service Reviews','KT26099','Budget Signatory/18') and R +efClass is not null and RefKey is not null group by DistGroup union s +elect null, DistDept, null, count(*) from wftask where DistDept in (' +D3347') and RefClass is not null and RefKey is not null group by Dist +Dept"; $str =~ s/(\s*'[^']*+?')//g; print $str
I get the message Nested quantifiers in regex; marked by <-- HERE in m/(\s*'^'*+? <-- HERE ')/ at C:\Perl\Perl_tests\SQLTest.pl line 6.

When I run it on the command line it works fine. As I have said in a another reply, I only started to use perl on Monday please excuse my ignorance.

Thanks

In reply to Re^2: strip text from a string by KalaMonkey
in thread strip text from a string by KalaMonkey

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.