Home > Blockchain >  RegEx to get all the string name in java before the dot
RegEx to get all the string name in java before the dot

Time:07-25

I want to write the Regular Expression for finding all the strings before the dot (.)

Example: abcd.FuncName(defg.GameName);

So I want the output as: abc and defg

CodePudding user response:

\w (?=\.)

Matches 1 or more letters/numbers followed by a dot (.). Link sends you to regex101 where you can test it out.

  • Related