havenwood changed the topic of #ruby to: Ruby 3.3.5 (3.4.0-preview2) https://www.ruby-lang.org | Logs https://libera.irclog.whitequark.org/ruby
dhruvasagar has joined #ruby
dhruvasagar has quit [Ping timeout: 244 seconds]
dhruvasagar has joined #ruby
dhruvasagar has quit [Ping timeout: 248 seconds]
dhruvasagar has joined #ruby
dhruvasagar has quit [Ping timeout: 272 seconds]
donofrio has joined #ruby
dhruvasagar has joined #ruby
dhruvasagar has quit [Ping timeout: 265 seconds]
donofrio has quit [Ping timeout: 245 seconds]
Rounin has quit [Ping timeout: 264 seconds]
dhruvasagar has joined #ruby
dhruvasagar has quit [Ping timeout: 252 seconds]
Rounin has joined #ruby
Rounin has quit [Changing host]
Rounin has joined #ruby
pages has quit [Quit: ZNC - https://znc.in]
dhruvasagar has joined #ruby
pages has joined #ruby
dhruvasagar has quit [Ping timeout: 265 seconds]
dhruvasagar has joined #ruby
dhruvasagar has quit [Ping timeout: 248 seconds]
dhruvasagar has joined #ruby
dhruvasagar has quit [Ping timeout: 246 seconds]
hansolo has quit [Remote host closed the connection]
hansolo has joined #ruby
dhruvasagar has joined #ruby
dhruvasagar has quit [Ping timeout: 276 seconds]
Rounin has quit [Ping timeout: 252 seconds]
dhruvasagar has joined #ruby
Rounin has joined #ruby
Rounin has quit [Changing host]
Rounin has joined #ruby
Linux_Kerio has joined #ruby
fercell has quit [Ping timeout: 245 seconds]
mange has joined #ruby
pgib has joined #ruby
Guest53 has joined #ruby
Guest53 has quit [Client Quit]
Guest53 has joined #ruby
Guest53 has quit [Client Quit]
dhruvasagar has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
hwpplayer1 has joined #ruby
dhruvasagar has quit [Ping timeout: 252 seconds]
dhruvasagar has joined #ruby
dhruvasagar has quit [Ping timeout: 265 seconds]
dhruvasagar has joined #ruby
o0x1eef has quit [Ping timeout: 252 seconds]
Vonter has quit [Ping timeout: 276 seconds]
dhruvasagar has quit [Ping timeout: 248 seconds]
dhruvasagar has joined #ruby
pgib has quit [Quit: 00 PC LOAD LETTER]
Vonter has joined #ruby
szkl has joined #ruby
grenierm has joined #ruby
araujo has quit [Ping timeout: 276 seconds]
o0x1eef has joined #ruby
mange has quit [Quit: Quittin' time!]
smp has joined #ruby
teardown has quit [Quit: leaving]
hwpplayer1 has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 252 seconds]
whysthatso125070 has joined #ruby
dhruvasagar has joined #ruby
dhruvasa` has joined #ruby
dhruvasagar has quit [Ping timeout: 276 seconds]
___nick___ has joined #ruby
Quiet-Oil9262 has quit [Quit: The Lounge - https://thelounge.chat]
dhruvasa` has quit [Ping timeout: 248 seconds]
dhruvasa` has joined #ruby
dhruvasa` has quit [Ping timeout: 252 seconds]
dhruvasa` has joined #ruby
Quiet-Oil9262 has joined #ruby
dhruvasa` has quit [Ping timeout: 252 seconds]
dhruvasa` has joined #ruby
dhruvasa` has quit [Remote host closed the connection]
donofrio has joined #ruby
grenierm has quit [Quit: Client closed]
Linux_Kerio has quit [Ping timeout: 252 seconds]
DuckZ has quit [Quit: Disconnected - going offline]
King_DuckZ has joined #ruby
user71 has joined #ruby
kiwi_36 has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
donofrio has quit [Ping timeout: 245 seconds]
donofrio has joined #ruby
<isene> I'm in need of some advanced regex magic; I need this: "aaa bbb ccc/'ddd eee/fff ggg' hhh/jjj 'kkk lll'" to become this: ["aaa", "bbb", "ccc/'ddd eee/fff ggg'", "hhh/jjj", "'kkk lll'"] --- I've tried all the combinations that I can think of, like .scan(/(?:\w|\S'[^']*')+/) but I just can't make it work. The purpose is to split a string by space - but not when there is a substring quoted with single
<isene> quotes. Any wizards in here who can cast a spell in my direction?
hwpplayer1 has joined #ruby
trillion_exabyte has quit [Ping timeout: 255 seconds]
trillion_exabyte has joined #ruby
hwpplayer1 has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.4)]
Guest97 has joined #ruby
Guest97 has quit [Client Quit]
Guest97 has joined #ruby
<adam12> isene: Does this work? ([^\s']+|'.+?')
donofrio has quit [Ping timeout: 248 seconds]
<kjetilho> adam12: no, see the third element in desired result.
<kjetilho> I think this works: x.split(%r{(\S*'.*?'|\s+)}).filter { |e| e !~ %r{^\s*$} }
<kjetilho> (taking advantage of split returning the split string as well when the pattern is enclosed in parenthesis, and just removing the split strings we don't care about.
<adam12> kjetilho: Ah yes. I see the difference. Interesting.
pgib has joined #ruby
Guest53 has joined #ruby
Guest53 has quit [Client Quit]
Guest53 has joined #ruby
Guest53 has quit [Client Quit]
Guest97 has quit [Ping timeout: 256 seconds]
Guest53 has joined #ruby
Guest53 has quit [Client Quit]
pgib has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Remote host closed the connection]
Guest53 has joined #ruby
hwpplayer1 has joined #ruby
<adam12> isene: Quickly wrote up this approach that doesnt' use regexp. https://gist.github.com/adam12/0b3539641a7294a2b43d4ad1d951ee36
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
desnudopenguino has quit [Ping timeout: 248 seconds]
___nick___ has joined #ruby
Guest53 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
stefanos82 has joined #ruby
Linux_Kerio has joined #ruby
desnudopenguino has joined #ruby
hwpplayer1 has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.4)]
donofrio has joined #ruby
stefanos82 has quit [Quit: Leaving]
donofrio has quit [Ping timeout: 265 seconds]
Guest53 has joined #ruby
Guest53 has quit [Client Quit]
Guest53 has joined #ruby
Guest53 has quit [Read error: Connection reset by peer]
Guest53 has joined #ruby
Guest53 has quit [Client Quit]
hwpplayer1 has joined #ruby
stefanos82 has joined #ruby
hwpplayer1 has quit [Quit: bye]
Artea has quit [Ping timeout: 264 seconds]
Sampersand has joined #ruby
Guest53 has joined #ruby
<isene> kjetilho: Yes, that works - but I'm a bit worried about performance, and this is the reason I was leaning to .scan - since what I'm actually using is a gsub; See here for the actual code to syntax highlight on the rsh commandline (the .c is an extension to the String class adding colors in terminal); https://gist.github.com/isene/256decf2520f9fd65052e60c00ca630b
<isene> And with further tweaking... this does it :) .scan(/(?:\S'[^']*'|[^ '])+/)
<Sampersand> Speaking of regex, I still have yet to find usages of `(?~) lol
Artea has joined #ruby
Artea has quit [Quit: ZNC 1.8.2 - https://znc.in]
Artea has joined #ruby
hwpplayer1 has joined #ruby
Guest53 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest53 has joined #ruby
dhruvasagar has joined #ruby
donofrio has joined #ruby
___nick___ has quit [Ping timeout: 276 seconds]
Guest53 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
stefanos82 has quit [Quit: Leaving]
hwpplayer1 has quit [Remote host closed the connection]
Guest53 has joined #ruby
Guest53 has quit [Ping timeout: 276 seconds]
cappy has joined #ruby
polishdub has quit [Quit: Lost terminal]
polishdub has joined #ruby
user71 has quit [Quit: Leaving]
howdoi has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
Linux_Kerio has quit [Ping timeout: 276 seconds]
hwpplayer1 has joined #ruby
mange has joined #ruby
hwpplayer1 has quit [Read error: Connection reset by peer]
Sampersand has quit [Quit: Client closed]
donofrio has quit [Ping timeout: 252 seconds]
Obsdark has joined #ruby
Obsdark has quit [Changing host]
Obsdark has joined #ruby