Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about lua-patterns

Read more about lua-patterns

python (12.9k questions)

javascript (9.2k questions)

reactjs (4.7k questions)

java (4.2k questions)

java (4.2k questions)

c# (3.5k questions)

c# (3.5k questions)

html (3.3k questions)

Questions - lua-patterns

Nginx Lua regex match first word

I try to convert regex into Lua language, from ([a-zA-Z0-9._-/]+) to ^%w+?([_-]%w+) I want to make match first word with '-' and '_': mar_paci (toto totot) toi-re/3.9 pouri marc (sensor) Phoenix; SA...
test-img

marcooo_i

regex

nginx

lua

lua-patterns

Votes: 0

Answers: 1

Latest Answer

You can use ^[%w%s_-]*%w It matches ^ - start of string [%w%s_-]* - zero or more alphanumerics, whitespaces, _ or hyphens %w - an alphanumeric char. See the Lua demo: local function extract(text) ...
test-img

Wiktor Stribiżew

Lua Script match multiple word

My first time, I try Lua script, I want to match on string (user-Agent), multiple substring to exclude them when it is match. pattern string is User-Agent pattern, and the multiple string are google, ...
test-img

ezceeaaaa

regex

nginx

lua

openresty

lua-patterns

Votes: 0

Answers: 1

Latest Answer

ngx.re.match uses PCRE regular expressions where * means roughly "zero or more repetitions of whatever is before it", so you must escape it: (\*google\*|\*safari\*|\*edge\*)
test-img

piotrp

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved