Questions tagged [oniguruma]

Oniguruma (鬼車) is a BSD licensed regular expression library which allows encoding (e.g. `UTF-8`, `EUC-JP`, `GB18030`) to be specified for each regular expression object. Use this tag for questions about Oniguruma regex syntax. Be sure to tag the language this library is used in.

Oniguruma (鬼車) is a BSD licensed regular expression library which supports Unicode characters in encodings such as UTF-8, UTF-16 and EUC-JP. It allows encoding to be specified for each regular expression object.

The Ruby programming language, since version 1.9, as well as PHP's multi-byte string module (since PHP5), use Oniguruma as their regular expression engine. It is usable in C/C++ and ports to Cocoa, Java and Erlang have also been made.

The current version is 5.9.4 (c) K.Kosako, updated at: 2013/04/04

Official Page - http://www.geocities.jp/kosako3/oniguruma/

54 questions
2
votes
1 answer

Text Mate lookbehind after nonfixed character length

I'm working on a syntax highlighting for a programming language not supported by Visual Studio Code. The highlighting is working well,but I'm facing a problem to highlight the following pieces of code: pool[] Test1 t1; pool[1] Test2 t2; pool[10]…
2
votes
2 answers

regex onigurama Negative lookbehind not working

I am trying to capture a line in a logfile using the onigurama regex library (in Logstash) using a negative look-behind but it still seems to match the line that it shouldn't. I am trying to match only the top level exception and not the one…
Arturski
  • 1,142
  • 3
  • 14
  • 26
2
votes
1 answer

Regular expression for capturing all skin-tone variations of an emoji

I'm trying to use a regex to capture tweets containing the substring at least twice, so I'm using an unsophisticated ^.+ .+ .+$. However this doesn't match strings which instead contain, for example, . Is there a smart way I can capture an emoji…
Cai
  • 1,726
  • 2
  • 15
  • 24
2
votes
0 answers

Matching 2 characters following a certain set of characters, but not matching anything in that set

I'm working on improving Github-Flavored Markdown syntax highlighting in Sublime Text, which uses the Oniguruma regex engine. Specifically, I'm trying to improve the matching of **bold**/__bold__ sections. Since working with regexes in .tmLanguage…
MattDMo
  • 100,794
  • 21
  • 241
  • 231
2
votes
2 answers

Equivalent to Vim's regex start and end match (`\zs` and `\ze`)?

If I wanted to replace only part of a match with something else in Atom, how would I do that? A Ruby regex solution would probably work, because Ruby uses a regex engine very much like Oniguruma (which is used by Atom). I found an Oniguruma manual…
Zaz
  • 46,476
  • 14
  • 84
  • 101
1
vote
1 answer

Oniguruma regex conditional group capture

I am attempting to capture the word function using Oniguruma regex (for VSCode syntax highlighting) into 2 different groups depending on if :: are the preceding characters. As far as I know Oniguruma does not support conditionals, hence I thought I…
gnikit
  • 1,031
  • 15
  • 25
1
vote
1 answer

Regex: Match word containing special characters

I am currently using a oniguruma regex to search for function like matches with the exception of some keywords. Ex, in the string "this is a test() and im() testing() thi[s]() this_[is]_a_fun(with,some,params)" the regex should…
1
vote
1 answer

Negating from symbol until the previous space

Trying to use logstash grok filters (oniguruma regex) to filter some logs. For a log entry that looks like this: 2019-03-24 17:57:14,202 p=19455 u=root | TASK [this is the task name msg=Debug message] ************************ I have written this…
carrotcakeslayer
  • 809
  • 2
  • 9
  • 33
1
vote
2 answers

How to match a whole word containing special characters?

I have words to match using only a single pattern. The criteria are one of the following: it contains a number or an underscore at the first letter, OR at least one special character (excluding underscore) within the word: Should…
Manu
  • 45
  • 1
  • 7
1
vote
1 answer

Convert GFM highlighted code block to Stack Overflow highlighted code block

1. Question I can't convert GFM highlighted code block to Stack Overflow highlighted code block. 2. Example For example, I need convert: Do not change this line ```markdown Sasha great! Sasha nice! She is beautiful, surprise! ``` Do not…
Саша Черных
  • 2,561
  • 4
  • 25
  • 71
1
vote
3 answers

Regex to detect period at end of string, but not '...'

Using a regex, how can I match strings that end with exactly one . as: This is a string. but not those that end with more than one . as: This is a string... I have a regex that detects a single .: /[\.]{1}\z/ but I do not want it to match…
Chris Cirefice
  • 5,475
  • 7
  • 45
  • 75
1
vote
1 answer

error: failed to run custom build command for `onig_sys v61.1.0`

error: failed to run custom build command for onig_sys v61.1.0 I am compiling the rust program https://github.com/trishume/syntect by running make packs. However it throws the error: $ make packs cargo run --example gendata -- synpack…
Evandro Coan
  • 8,560
  • 11
  • 83
  • 144
1
vote
0 answers

Oniguruma 1.1.0 not compatible with Ruby 2.3.1

I installed ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux] and rails 4.2.6. I wrote a Gemfile which has all bundles. Gemfile: source 'http://rubygems.org' source 'http://gems.github.com' #New gem files from Ajay #gem 'activesupport',…
Ajay Kulkarni
  • 2,900
  • 13
  • 48
  • 97
1
vote
1 answer

Regex to Find a Word Inside Curly Braces

I need a way to search the text using RegEx and find a word thats inside Latex command (which means that it's inside curly braces) Here is the example: Tarzan is my name and everyone knows that {Tarzan loves Jane} Now if you search for regex:…
stx932
  • 145
  • 9
1
vote
2 answers

Trying to match a sequence if not preceded by one group, but yes if preceded by another

This is getting a little meta, but I'm trying to figure out a regex to match regexes for syntax highlighting purposes. There's a nice long backstory, but in the interest of brevity I'll skip it. Here's what I'm trying to do: I need to match a…
MattDMo
  • 100,794
  • 21
  • 241
  • 231