Howto get round parenthesis literally 
Author Message
 Howto get round parenthesis literally

in a regular expression, in a pattern, how do I epress a round bracket
(parenthesis "(" )? I already tried ( and \(

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Tue, 25 Mar 2003 03:00:00 GMT  
 Howto get round parenthesis literally

Quote:

>in a regular expression, in a pattern, how do I epress a round bracket
>(parenthesis "(" )? I already tried ( and \(

If you've already tried ( and \(, and neither works, then it seems very
likely you're using this regex in a context that entails several layers
of double quote processing. In other words, it appears you need more
backslashes. I won't guess how many you need (I'd need to see exactly
what you're doing). Instead, I'd recommend you use single character
classes to represent ( and ), namely, [(] and [)] for literal left and
right parentheses. These classes are unaffected by any number of levels
of double-quoted string processing, so they should work for you.

BTW, thanks for providing yet another opportunity to show some others
in this newsgroup why using single character classes to represent regex
metachar literals are more robust than backslashes.

Sent via Deja.com http://www.deja.com/
Before you buy.



Tue, 25 Mar 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. less parentheses --> fewer parentheses

2. less parentheses --> fewer parentheses

3. Dangling Closing Parentheses vs. Stacked Closing Parentheses

4. Getting my head round pack

5. Getting round verilog hierarchical structure

6. round rounds right?

7. Round and Round we go

8. If blocks are objects why can't they be stored literally in arrays:

9. How can i write class definitions literally?

10. REPOST: Literally thousands of Pythonic online articles

11. Literally thousands of Pythonic online articles

12. ?sys.argv values more literally?

 

 
Powered by phpBB® Forum Software