Jump to content

Search pattern


Patrick

Recommended Posts

Hi!

I'm pretty ignorant of the search pattern, I want some help with this.

Example string: "something #ffffff anothersomething color:#ffffff"

I'd like to choose the color codes that don't have the color: word before. (In this example, the first color code)

 

example

#ff0000 -> result: true

color:#ff0000 -> result: false

Link to post
  • Patrick changed the title to Search pattern
10 hours ago, stPatrick said:

Hi!

I'm pretty ignorant of the search pattern, I want some help with this.

Example string: "something #ffffff anothersomething color:#ffffff"

I'd like to choose the color codes that don't have the color: word before. (In this example, the first color code)

 

example

 #ff0000 -> result: true

color:#ff0000 -> result: false

I don't understand ! Do you want to check is the color inside the string ? or what ? 

Link to post
local _output = outputChatBox

function outputChatBox(text, ...)
  if string.find(text, 'color:#') then
    string.gsub(text, 'color:', '')
  end
  return _output(text, unpack(arg))
end

 

Edited by Pollo
Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...