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 7790533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:36:52+00:00 2026-06-01T21:36:52+00:00

Does anyone out there know of a regex command that will take the following

  • 0

Does anyone out there know of a regex command that will take the following string

 url = http://184.154.145.114:8013/wlraac name = wlr  samplerate = 44100 channels = 2       format = S16le

and remove everything but the following

 wlr

This line will come up multiple times, where everything changes after the = sign and each time all I want to keep is whats after name =

any help is appreciated

  • 1 1 Answer
  • 0 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-06-01T21:36:54+00:00Added an answer on June 1, 2026 at 9:36 pm

    You could do something like

    .*name =\s*(\w+).*
    

    and replace with the content of group 1

    See it here on Regexr

    I search for “name =” and anything before. The \s* matches the following whitespace.

    Then the \w+ inside brackets. \w will match any character and digit and underscore (if you use the option Pattern.UNICODE_CHARACTER_CLASS otherwise it sticks to ASCII only) . Because of the brackets it is stored in the first group.

    String in = " url = http://184.154.145.114:8013/wlraac name = wlr  samplerate = 44100 channels = 2       format = S16le";
    
    Pattern r = Pattern.compile(".*name =\\s*(\\w+).*");
    Matcher m = r.matcher(in);
    
    String result = m.replaceAll("$1");
    System.out.println(result);
    

    Or your code

    String str = line2.replaceAll(".*name =\\S*(\\W).*", "$1");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone out there know about examples and the theory behind parsers that will
Does anyone know if there is a framework out there that is able to
Does anyone know if there is a help authoring tool out there that can
Does anyone know of any documentation out there that lays out what SQL functions
Does anyone know of an application or system out there for tracking changes (files
Does anyone out there know what image format results in the fastest loading speeds?
Does anyone know of a good function out there for filtering generic input from
Does anyone out there know if it is possible to use sharding with a
Does anyone out there know if its possible to show a working version of
Does anyone out there know of any combination social media/portal platforms with a multi-vendor

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.