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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:38:56+00:00 2026-05-30T03:38:56+00:00

I have a cache file with an array of user agents. When i print

  • 0

I have a cache file with an array of user agents.

When i print each user agent out, this is what it looks like:

@^Mozilla/5\.0 \(.*Linux i686.*\) AppleWebKit/.* \(KHTML, like Gecko\).*Chrome/6\..*Safari/.*$@ 
@^Mozilla/5\.0 \(X11; U; Linux.*; .*; rv\:1\.9\..*\) Gecko/.* Firefox/.* Maemo Browser 1\.7\..*$@ 
@^Mozilla/5\.0 \(.*Linux i686.*\) AppleWebKit/.* \(KHTML, like Gecko\).*Chrome/7\..*Safari/.*$@ 
@^Mozilla/5\.0 \(.*Linux i686.*\) AppleWebKit/.* \(KHTML, like Gecko\).*Chrome/8\..*Safari/.*$@ 
@^Mozilla/5\.0 \(.*Linux i686.*\) AppleWebKit/.* \(KHTML, like Gecko\) .*Iron/6\..* Safari/.*$@ 
@^Mozilla/5\.0 \(.*Linux i686.*\) AppleWebKit/.* \(KHTML, like Gecko\) .*Iron/7\..* Safari/.*$@ 
@^Mozilla/5\.0 \(.*Linux i686.*\) AppleWebKit/.* \(KHTML, like Gecko\).*Chrome/9\..*Safari/.*$@ 

ect ect....

Now it looks like these user-agents have been escaped, so I’ve stripslashes() them.

I’ve also noticed some invalid characters here (@,^,.*$@), so I’ve str_replaced() them with nothing.

And the end result:

Mozilla/5.0 (.Linux i686.) AppleWebKit/. (KHTML, like Gecko).Chrome/6..Safari/ 
Mozilla/5.0 (X11; U; Linux.; .; rv:1.9..) Gecko/. Firefox/. Maemo Browser 1.7. 
Mozilla/5.0 (.Linux i686.) AppleWebKit/. (KHTML, like Gecko).Chrome/7..Safari/ 
Mozilla/5.0 (.Linux i686.) AppleWebKit/. (KHTML, like Gecko).Chrome/8..Safari/ 
Mozilla/5.0 (.Linux i686.) AppleWebKit/. (KHTML, like Gecko) .Iron/6.. Safari/ 
Mozilla/5.0 (.Linux i686.) AppleWebKit/. (KHTML, like Gecko) .Iron/7.. Safari/ 
Mozilla/5.0 (.Linux i686.) AppleWebKit/. (KHTML, like Gecko).Chrome/9..Safari/

I’m planning to insert these user-agents into a database (already full of hundreds of thousands), and I’m worried they’re still invalid in some way that I haven’t noticed.

If I do insert these into the DB and they’re invalid, I would then have to delete the whole DB, and start all over…

So I don’t want to take any risks…

Can you guys spot anything wrong with these user-agent strings?

🙂

  • 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-05-30T03:38:57+00:00Added an answer on May 30, 2026 at 3:38 am

    These are regular expressions, not invalid characters. If you simply match the strings against the user agent string, they will not match. They are meant to be matched as regular expressions.

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

Sidebar

Related Questions

I have a json file that looks like this: { status: 200, data: {
we have a cache which I would like to put some transaction scopes around
In my Rails app, in app/models/ , I have a file named array.rb which
I have a source file that file that contain to be translated strings. Each
I have a zend cache which stores an array from the db. The cache
I have this problem i cant workaround. I cache data in serialized format in
I have a site where a user can download a file. Some files are
So I have a file called cache, which stores traffic analysis of a site,
Please have a look at this validation array in my cakephp app for model
I have a jar file with resources (mainly configuration for caches, logging, etc) that

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.