"Regular Expression?" 
Author Message
 "Regular Expression?"

Folks:

"What is the Match Pattern regular expression to match any one of the
following"

UCHAR, ULONG, USHORT, UINT, char, long, short, int, char*, char *

I currently have:

[U*][cC|sS|iI|lL][hH|oO|nN][aA|oO|nN][(rR|tT|gG)*][(tT|gG)*]

This only catches "USHORT" and not "UCHAR"; Please help, thanks!

Kevin"



Sat, 24 Jan 2004 02:26:11 GMT  
 "Regular Expression?"
I think this should work... But don't quote me on that... I haven't tested
it or anything!

{U} ([Cc][Hh][Aa][Rr]{\*}{ \*}) | ([Ll][Oo][Nn][Gg]) |
([Ss][Hh][Oo][Rr][Tt]) | ([Ii][Nn][Tt])

where the \* symbolises a dereferenced *
I can't remember the symbols exactly, so I have used { } = optional, | = or,
[ ] = choose on or the other from inside

If this works, could you get back to me and let me know?

Good luck

--
Slade Squire
Programmer
Rectifier Technologies Pacific
Melbourne, Australia


Quote:
> Folks:

> "What is the Match Pattern regular expression to match any one of the
> following"

> UCHAR, ULONG, USHORT, UINT, char, long, short, int, char*, char *

> I currently have:

> [U*][cC|sS|iI|lL][hH|oO|nN][aA|oO|nN][(rR|tT|gG)*][(tT|gG)*]

> This only catches "USHORT" and not "UCHAR"; Please help, thanks!

> Kevin"



Sat, 24 Jan 2004 14:46:18 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Regular Expression Pattern Matching "State" Object

2. Replace with regular expressions "except if..."

3. "Invert" regular expression matching

4. Regular expression problem: "|" interferring with ".*?"

5. string.join(["Tk 4.2p2", "Python 1.4", "Win32", "free"], "for")

6. Distutils "not a regular file -- skipping"?!?

7. Need help : "Expression is ambiguous."

8. GNAT 2.00 - What "ambiguous expression"

9. Problem with "lamba expression"

10. Wish 8.05 error "Malformed expression work"

11. "if" expressions sometimes causes abort

12. proto-PEP: "unless" expression

 

 
Powered by phpBB® Forum Software