DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Hardening MCP Gateways: Mitigating July 28 Security Risks in Java Applications
  • Mitigating Cache Stampedes in Dynamic API Translation Using Java 21 Virtual Threads
  • AGENTS.md Makes Your Java Codebase AI-Agent Ready
  • Going Stateless: Scaling MCP Servers to Cloud-Native Java and HTTP

Trending

  • Building Cross-Team SLO Contracts for Performance Accountability
  • Jakarta NoSQL 1.0: A Way To Bring Java and NoSQL Together
  • Everything About HTTPS and SSL in Java
  • Loop Engineering: The Layer After Prompt, Context, and Harness Engineering
  1. DZone
  2. Coding
  3. Java
  4. Java: RegEx: Splitting A Space-, Comma-, And Semi-colon Separated List

Java: RegEx: Splitting A Space-, Comma-, And Semi-colon Separated List

By 
Snippets Manager user avatar
Snippets Manager
·
Aug. 05, 07 · Code Snippet
Likes (1)
Comment
Save
Tweet
Share
38.2K Views

Join the DZone community and get the full member experience.

Join For Free
// Greedy RegEx quantifier used
//   X+ = X, one or more times
//   [\\s,;]+ = one or more times of either \s , or ;


    String test_data = "hello world, this is a test, ;again";
    _logger.debug("Source: " + test_data);
    
    for (String tag : test_data.split("[\\s,;]+"))
    {
      _logger.debug("Received tag: [" + tag + "]");
    }
Java (programming language)

Opinions expressed by DZone contributors are their own.

Related

  • Hardening MCP Gateways: Mitigating July 28 Security Risks in Java Applications
  • Mitigating Cache Stampedes in Dynamic API Translation Using Java 21 Virtual Threads
  • AGENTS.md Makes Your Java Codebase AI-Agent Ready
  • Going Stateless: Scaling MCP Servers to Cloud-Native Java and HTTP

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook