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
1
vote
1 answer

Regex/Textmate Confusion

I'm trying to create a Textmate snippet, but have run into some difficulties. Basically, I want to type in a Name and split it into its parts. Example, Bill Gates: (Bill), (bill), (Gates), (gates), (Bill Gates), (Bill gates), (bill Gates), (bill…
esiegel
  • 1,773
  • 2
  • 19
  • 31
1
vote
2 answers

How to add your own syntax to Sublime Text 2

I want to add my own syntax (language) to Sublime Text 2. I already know how to include it to the syntax list so my only problem now is the syntax highlighting. But first I want to understand the Oniguruma language used for matching the words I want…
1
vote
1 answer

Oniguruma Regex - Match entire group content and not just the last occurrence

I'm writing a syntax highlighter for the Sublime Text editor (that uses the Oniguruma regex definitions). Basically, I have something like this: Regex: \((\w+\s*)*\) Test: (how are you) Capturing groups: 1. you My problem is, that only the last…
Pold
  • 337
  • 1
  • 11
1
vote
4 answers

Explain this Regular Expression please

Regular Expressions are a complete void for me. I'm dealing with one right now in TextMate that does what I want it to do...but I don't know WHY it does what I want it to do. /[[:alpha:]]+|( )/(?1::$0)/g This is used in a TextMate snippet and what…
James P. Wright
  • 8,991
  • 23
  • 79
  • 142
1
vote
3 answers

Given regex does not match to the end

I have a regex expression: ^([ \t\r]*\S+){2}$ It matches name and group matches e, in name. I expected to not to match name, but name name; such as I wanted \S+ work till it matches. I can make it work just a bit changing it: ^([ \t\r]*\S+)([…
user2688153
  • 47
  • 1
  • 8
1
vote
2 answers

How to know if a match is adjacent to the previous match

In a construction like string.scan(regex){...} or string.gsub(regex){...} how can check if the match for a loop cycle is adjacent to the previous one in the original string? For example, in "abaabcaaab".scan(/a+b/){|match| ... continued =…
sawa
  • 165,429
  • 45
  • 277
  • 381
1
vote
4 answers

Match comma separated list with Ruby Regex

Given the following string, I'd like to match the elements of the list and parts of the rest after the colon: foo,bar,baz:something I.e. I am expecting the first three match groups to be "foo", "bar", "baz". No commas and no colon. The minimum…
Christoph
  • 1,580
  • 5
  • 17
  • 29
0
votes
1 answer

Textmate Find and Replace with Wildcard

Here's what I have in a few hundred places [:admin, @account]. What I want to do is remove the [:admin, ] so that all that's left is @account or whatever object I have there. Because sometimes it's [:admin, ticket] or [:admin, group]. Is it possible…
Marc
  • 2,584
  • 5
  • 33
  • 47
0
votes
0 answers

Regex to detect literal strings (with quotes) using begin and end regex?

I am attempting to write some regex that detects a valid string (with single quotes). I specifically mean that it is looking for valid string literals, as in don't match this text 'but do match this text'. This is being done in a TextMate grammar…
Finn E
  • 309
  • 2
  • 12
0
votes
1 answer

Match beginning of the line only if pattern is found anywhere after the first part of the positive lookahead

I'm having a hard time with vscode's oniguruma regex parsing for TextMate. Apparently you can't use a newline inside a lookahead, even though oniguruma actually supports it, it's probably not enabled in vscode's version of oniguruma. I need to match…
ghaschel
  • 1,313
  • 3
  • 20
  • 41
0
votes
1 answer

find substring with special characters

I have pattern 'šalotka 29%' and i need to know if string 'something something šalotka 29% something' contains the pattern but not if the pattern is part of a longer word 'something something šalotka 29%something' I have this mb_eregi('\b' .…
Kikimis
  • 9
  • 1
0
votes
2 answers

Regex issue - fine backwards and not forwards Textmate

I'm not very good with regular expressions but in Textmate, I'm trying to clear out some multi-lines in an XML file that looks like .... .... and I'm using this in the find/replace with…
Kenny Shen
  • 4,773
  • 3
  • 21
  • 18
0
votes
1 answer

Trying to write Grok pattern for specific log files

I am trying to write a Grok pattern for the app generated log files. I am unable to filter out few fields. Input Log File 2019-05-02 05:32:41,017 INFO [some_class_name] Property: MatchResult(id=null, symbol=BTC_ETH, a=13172871, b=11372687136,…
Saurabh
  • 326
  • 3
  • 10
0
votes
0 answers

Logstash regex pattern issue

I have sample plain text: ..done, Total time: 10, Errors: 5, there is some text here Results:, , Total time: 10, Errors: 5, , [INFO]... I am trying to parse values of Total time and Errors fields in Logstash grok filter with the following…
rw412
  • 3
  • 1
  • 4
0
votes
1 answer

How to call a batch builder script on a Rust cargo build script?

How to call a batch builder script on a Rust cargo build script? The project rust-onig requires to compile the oniguruma C project. This is originated from the question error: failed to run custom build command for `onig_sys v61.1.0` which attempts…
Evandro Coan
  • 8,560
  • 11
  • 83
  • 144