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

  • Home
  • SEARCH
  • 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 8123381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:09:51+00:00 2026-06-06T06:09:51+00:00

testA = test.test test.test local t1 = {} for X in string.gfind (testA, [^

  • 0
    testA = "test.test test.test"
    local t1 = {}
    for X in string.gfind (testA, "[^ ]+") do
    table.insert (t1 ,X)
    end
    local first = table.concat(t1, "", 1, 1);

    --output/first test.test

    testA = "11.11.11.11 test.test"
    local t2 = {}
    for X in string.gfind (testA, "[^ ]+") do
    table.insert (t2 ,X)
    end
    local first = table.concat(t2, "", 1, 1);

    --output/first 11.11.11.11

    testA = "100.100.100.100  test.test"
    local t3 = {}
    for X in string.gfind (testA, "[^ ]+") do
    table.insert (t3 ,X)
    end
    local first = table.concat(t3, "", 1, 1);

    --output/first 100.100.100.100    test.test

Does anyone know why the 3rd item wont split with gfind? , cant figure out why
it works for two strings but not the third.

  • 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-06T06:09:53+00:00Added an answer on June 6, 2026 at 6:09 am

    Your problem is that a tab character is not the same thing as a space. If you want to skip all whitespace characters, you need to actually skip whitespace characters, not just regular space:

    string.gfind (testA, "[%S]+")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How does one test a method that does some interactions with the local D-Bus
why isn't the cookies storing? the local website I made has a setcookie(test,time()); in
#1 Lua: local test = Test(); #2 C: //creating lua's test luaL_newmetatable(L, someTable); lua_userdata
On my local test machine it works fine, but on the server it will
I'm trying to test a rest api for upload a local file to a
I have used my local iis to test the site and now that its
I am trying to test Google Maps in development sites under IIS. My local
What is the easiest way to setup a test environment on my local machine
I want to run a hadoop unit test, using the local filesystem mode... I
In PHP I'm receiving a string from the user for a local file directory

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.