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!

Regular Expressions Help

Status
Not open for further replies.

RileyCat

Programmer
Apr 5, 2004
124
US
I need help to fix a regular expression phrase I am testing for.

I have a string that will always contain the string "]C1". I have been handling that fine for many years using the regular expression ........

"][Cc]1"

But now, I have to also handle the string as EITHER "]C1" or "[C1". I am not sure how to modify this regular expression phrase to handle the open bracket.

I tried ....... "[]\[][Cc]1" ;

But, it doesn't compile.

Can somebody out here please help me. I need to be able to handle EITHER "[" or "]" in my string.

Any help on how I need to modify my regular expression phrase is appreciated.

THANK YOU!!!!!!!!

Stay Cool Ya'll! [smile2]

-- Kristin
 
what's the backslash for ?

makes sense that way [\[\]] and will compile

 
Thanks for the help. I finally got it to work as ....

"[[]]"

Weird, but it works.

Stay Cool Ya'll! [smile2]

-- Kristin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top