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 6652417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:08:09+00:00 2026-05-26T01:08:09+00:00

Making an argument parser. I want to split a string into an array where

  • 0

Making an argument parser. I want to split a string into an array where the delimiter is ", " except when preceded by "|". That means string

"foo, ba|, r, arg"

should result in

`["foo", "ba|, r", "arg"]`

I’m trying to use this regex: (?<!\|), which works in http://regexhero.net/tester/ but when I try

args.split(/(?<!\|), /)

in ruby, I get an error: undefined (?...) sequence: /(?<!\|), /

  • 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-05-26T01:08:10+00:00Added an answer on May 26, 2026 at 1:08 am

    Ruby’s regex engine doesn’t support lookbehind (yet).

    You’d need to switch to 1.9 or use Oniguruma.


    If that’s not an option, you can search for |, and replace it with some sort of marker. After all is said and done, put the |, back.

    You can also try a regex like:

    /(?:[^|]), /
    

    But obviously the (?:[^|]) is not zero-width, which means you’ll need to do some extra work afterwards.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am making insert function that takes $table argument and $cols(as array)argument. it inserts
I am making a function that turns the first argument into a PHP var
I'm making a WinForms app with a ListView set to detail so that several
Briefly: I'm making a custom view, I want a field listing the two taxonomy
Okay, I'm making a project that implements a Double Linked List using classes, templates
This is beyond both making sense and my control. That being said here is
Making an app where we want to send a photo to a server along
I'm making a program that is using Windows Shell Integration, and the registry changes
Making echo of a question around the web: Is the syntax for svn:ignore patterns
When making changes using SubmitChanges() , LINQ sometimes dies with a ChangeConflictException exception with

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.