Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unmatched bracket ( in regex

Status
Not open for further replies.

zzzqqq

Programmer
Oct 12, 2005
17
IE
Hi,
Anyone have an idea behind this one? I'm trying to search a string say:
branchRetrievalDetails.scheduleAtFixedRate(branchDetailsServlet,getTomorrowMorning6am(),repeat);
for something like this:
scheduleAtFixedRate(
but when I do a line =~ string comparison, I get following error:
Unmatched bracket in regex: marked by <!-- HERE in m/scheduleAtFixedRate( <-- Here at filename.pl line 132
Is it possible to delimit the string to search for it like?
string comparison =~ tr/(/\(/;
Tried this but got same error.
Any ideas?
Cheers,
Mark.
 
That's cos brackets are special characters (for capturing) in regular expressions.
If you want to match an open bracket literally then you need to escape it with a backslash:
Code:
/matchdata[red]\([/red]/;

Trojan.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top