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?

Recommended Answers

All 3 Replies

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

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.