Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Regex wild card substitution - SOLVED

by Lori713 (Pilgrim)
on Nov 11, 2008 at 18:06 UTC ( [id://722929]=perlquestion: print w/replies, xml ) Need Help??

Lori713 has asked for the wisdom of the Perl Monks concerning the following question:

I have a regex to replace some SQL criteria with a more user-friendly label on a report.

The SQL where clause is (and, yes, there is a reason for the extraneous parentheses here which I won't bore you with):

AND ((P.NCG_FIS_MGR IN ('H', 'I')))
My regex is:

$sub_name_for_codes =~ s/AND \(\(P.NCG_FIS_MGR IN \('.*'\)\)\) / AND Fiscal Manager Name like $fis_mgr_name_va +lue /g;
This regex is apparently being skipped because no substitions are being made.

The following works fine:

The SQL WHERE clause:
AND P.PROJECT_ID IN ('521590', '529302', '529808', '528230') AND I.NC_ +NAME LIKE 'Thom%'
using this regex:
$sub_name_for_codes =~ s/AND P.PROJECT_ID IN \('.*'\) AND I.NC_NAME LI +KE / AND Investigator like /g;
Any suggestions where I've wandered off the path would be appreciated. Thanks!

Lori

Previous content restored above by GrandFather

I was going to ask a question about why a regex wasn't working and forgot to put the '\' in front of the parentheses to make it escape. Sorry for the inconvenience.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-19 21:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found