Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 909143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:49:45+00:00 2026-05-15T16:49:45+00:00

I have a very uniform set of data from Radius messages that I need

  • 0

I have a very uniform set of data from Radius messages that I need to add into our log management solution. The product offers the ability to use a regex statement to pull out the various data in a few forms.

1) Individual regular expressions for each piece of data you wish to pull out

    <data 1 = regex statement>
    <data 2 = different regex statement>    
    <data 2 = yet another regex statement>

2) A singular regular expression using capture groups

    <group = regex statement with capture groups>
        <data 1 = capture group[X]
        <data 2 = capture group[Y]
        <data 3 = capture group[Z]
    </group>

<158>Jul 6 14:33:00 radius/10.10.100.12 radius: 07/06/2010 14:33:00 AP1A-BLAH (10.10.10.10) - 6191 / Wireless - IEEE 802.11: abc1234 - Access-Accept (AP: 000102030405 / SSID: bork / Client: 050403020100) 

I want to pull out several bits of data, all of them between spaces. Something along the lines of the following doesn’t seem efficient:

(.*?)\s(.*?)\s(.*?)\s(.*?)\s(.*?)\s(.*?)\s

So, given the data above, what’s the most efficient Java Regex that will grab each field in between a set of spaces and put it into a capture group?

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:49:45+00:00Added an answer on May 15, 2026 at 4:49 pm

    You could be more specific:

    (\S*)\s(\S*)\s(\S*)\s(\S*)\s(\S*)\s(\S*)\s
    

    \S matches a non-space character – this makes the regex more efficient by avoiding backtracking, and it allows the regex to fail faster if the input doesn’t fit the pattern.

    I.e., when applying your regex to the string Jul 6 14:33:00 radius/10.10.100.12 radius: 07/06/2010, it takes the regex engine 2116 steps to find out that it can’t match. The regex above fails in 168 steps.

    Alan Moore’s suggestion to use (\S*+)\s(\S*+)\s(\S*+)\s(\S*+)\s(\S*+)\s(\S*+)\s results in another improvement – now the regex fails within 24 steps (nearly a hundred times faster than the initial regex).

    If the match is successful, Alan’s and my solution are equivalent, your regex is about ten times slower.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have very very big html page/data. I need to fetch data under h1
I have very long integer sequences that look like this (arbitrary length!): 0000000001110002220033333 Now
I need to generate a random number from the following data: 0-10 : 23%
I have a radial gradient texture (RGBA) that goes from a black fully opaque
at the moment, I have a very large spreadsheet (40k+ rows), the data includes
I have a lot of text data with different structure. I need to extract
I'm dealing with some very non-uniform data and I'm using Ruby regular expressions to
i have very serious problem if any tech expert can help...thank you in advance..
I have very simple piece of code. The goal is when i input four-digit
I have very strange problem while I am submitting a practice problem on codechef.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.