Hi, i want to match a function-call in a text file. Which means:

print();
pRinT54();
print ();
print                ()               );

I'm using this regexp, which only matches if there are no spaces:

((?:[A-Za-z_][A-Za-z_0-9]*)(\\s*)(\\(.*\\))(\\s*)(;))

Sorry for the ugly regexp :(

Anyone have any idea why it doesn't match if there are whitespaces?

Shouldn't \\s* match any numbers of whitespaces?

try this:

((?:[A-Za-z_][A-Za-z_0-9]*)(\s*)(.*)\)(\s*)(;))

I have, but i get "Unknown escape sequence" when i compile :(

((?:[A-Za-z_][A-Za-z_0-9]*)(\\s*)(.*)\\)(\\s*)(;))
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.