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
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Building IoT Time-Series Applications With Java and Apache IoTDB
  • Building Time-Series Applications With Java and InfluxDB
  • Embabel vs LangGraph4j: Two Agentic Philosophies for Investment and Risk Analysis in BFSI
  • Jakarta Batch in Practice: Reliable Chunk-Oriented Processing for Enterprise Workloads

Trending

  • How Go Maps Work: From Buckets to Swiss Tables
  • Locking Down the Enterprise: Data Security Patterns for AI Integrations
  • Why Real-Time Data Pipelines Are Becoming the Foundation of Industrial AI
  • From ETL, ELT, and EtLT to Agent: What Is Changing in Enterprise Data 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

  • Building IoT Time-Series Applications With Java and Apache IoTDB
  • Building Time-Series Applications With Java and InfluxDB
  • Embabel vs LangGraph4j: Two Agentic Philosophies for Investment and Risk Analysis in BFSI
  • Jakarta Batch in Practice: Reliable Chunk-Oriented Processing for Enterprise Workloads

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