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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:16:00+00:00 2026-06-07T18:16:00+00:00

am new to regex, so am having a hard time compiling my own pattern.

  • 0

am new to regex, so am having a hard time compiling my own pattern.

Basically am reading the LogCat from my android phone and am trying to break this string into pieces to be able to display it in TextView

This is the actually string am trying to token.
“07-06 12:18:45.790: W/dalvikvm(571): TaintLog: OSNetworkSystem.write(91.121.171.39) received data with tag 0x400 data=[POST / HTTP/1.1”

Am able to retrieve the number after “Tag” using the scanner method, but now I need to extract the IP address from the OSnetworkSystem.Write(xxx.xxx.xxx.xxx)

Can anybody provided me some tips on what to use to be able to extra the IP address.

  • 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-07T18:16:01+00:00Added an answer on June 7, 2026 at 6:16 pm

    Well, for the regex part, I can help on.

    The regular expression:

    ([0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3})
    

    Would match any IP Address in a given string.

    For RegExp I use a website, http://rubular.com/ which has really helped with my workflow. I can throw in any number of “test cases” and start writing the regex code.


    Editing per comments below.

    Instead of re-inventing the wheel. I found a great write up on IPv4 Regex:
    How do I write a regular expression that matches an IPv4 dotted address?

    Which basically says:

    /^0*([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])\.0*([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])\.0*([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])\.0*([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])$/
    

    It is long and complex. But following the write up, should give you some good understanding in what it actually does.

    In my experience, the more complex & relient we get with regex success rates, the more it is going to probably fail. I’d suggest never relying on regex for critical data … Find another way, there always is 🙂

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

Sidebar

Related Questions

I'm new to .NET and having a hard time trying to understand the Regex
I'm having problems with a Java Regex Pattern Syntax expression. toCensor = toCensor.replaceAll((new StringBuilder(((?i)))).append(word).toString(),
Im really having a hard time in matches constraints in grails, im pretty new
I'm new with regex and I'm having a trouble with excluding a word from
i having some hard time on this, i'm trying to get my first WP7
I'm new to regex in Java and am having trouble getting it to work
I used it in C# var validString = new Regex(@^[a-z][a-z\d!@#$%\^&*()\-+]{0,7}$(?<=\d\D+), RegexOptions.Compiled); I am trying
I am new to Regex .I want to match pattern of my file ..
I'm pretty new on grails, I'm having a problem in matches validation using regex.
I am trying to remove from a string using Regex. I am receiving a

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.