online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static void main(String[] args) { String sentence = "Lorem ipsum dolor sit amet, consectetur "; // Define a regular expression to match words Pattern wordPattern = Pattern.compile("\\b\\w+\\b"); // Create a matcher for the input sentence Matcher matcher = wordPattern.matcher(sentence); // Count the number of words int wordCount = 0; while (matcher.find()) { wordCount++; } System.out.println("The number of words is " + wordCount + "."); } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue