0

I my case I have the following text:

- (NSUInteger) launcherView:(HMLauncherView *)launcherView 
        numberOfIconsInPage:(NSUInteger)page;

And I want to find all the matches for this method. The regexp should look like something like this:

launcherView:<any number of characters><any number of whitespaces or "ends of line">numberOfIconsInPage:

I know <any number of characters> means (.+) and <whitespace> means \s but how to write the whole expression? My main problem - I can't make it searching for any combination of whitespaces because it differs whitespace characters and "end of line".

Vyachaslav Gerchicov
  • 2,317
  • 3
  • 23
  • 49

1 Answers1

1

The Regex could be this one:

/launcherView:.+(\s*|\s*$)numberOfIconsInPage:/

In particular, the ".+" matches any character, the (\s*|\s*$) matches either only whitespaces until the "numberOfIconsInPage" or any number of whitespaces until the end of line.

nerdbeere
  • 84
  • 5