RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find C++ Function Parser
Expression
(?<expo>public\:|protected\:|private\:) (?<ret>(const )*(void|int|unsigned int|long|unsigned long|float|double|(class .*)|(enum .*))) (?<decl>__thiscall|__cdecl|__stdcall|__fastcall|__clrcall) (?<ns>.*)\:\:(?<class>(.*)((<.*>)*))\:\:(?<method>(.*)((<.*>)*))\((?<params>((.*(<.*>)?)(,)?)*)\)
Description
Parses a C++ function, including return type, declaration type, namespace, class, method, exposure (public, private, protected) and params.
Matches
public: void __thiscall myClass::method(int, class myOtherClass * ) | public: void __thiscall myNamespace::myClass::method(void) | protected: class std::string __cdecl Library::Class::Method(class Param *, enum Type & const)
Non-Matches
myfunc(3) | object::myFunc(9, 4) | object->method(var)
Author Rating: The rating for this expression. Sean Sube
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: first "match" test case is incorrect
Name: Erwin
Date: 1/30/2016 4:33:28 AM
Comment:
the method name must consist of a namespace, class and name part. the namespace is optional, but its separator ("::") is not optional. yet the first test data does not have that separator.


Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials