« first day (389 days earlier)
← previous day
next day →
last day (3403 days later) »
Jerry
09:52
@HamZa I think they were looking for some kind of bot that would do the operation in this room =P
HamZa
@Jerry hehe
Cas Nouwens
@HamZa
treasure.diylol.com/uploads/post/image/646459/…
HamZa
@CasNouwens lol
Cas Nouwens
hehhe
i always think of that when someone types hehe
4 hours later…
Javier Diaz
13:41
Dem regex
CSᵠ
13:59
?
3 hours later…
CSᵠ
17:24
Cisco ASA Series Command Reference, I - R Commands - match regex
2 hours later…
CSᵠ
19:27
codegolf, KISS-ed regex
codegolf.stackexchange.com/a/25196/7635
CSᵠ
19:46
u golf @HamZa ? :)
HamZa
@CSᵠ Sometimes, but it's hard with php ...
CSᵠ
indeed
that's what i thought
but looks like i won this
just.. no love golfing...
ppl are too competitive
Isti115
20:00
hi
is anybody here_
?
CSᵠ
morning @Isti115
Isti115
20:35
I have a thing which I don't know if I can do in regex
HamZa
@Isti115 we love challenges :P
Isti115
let's say, I have a list of strings between quotes separated with spaces like this:
"asdf" "qwerty" "cheese"/ "something" "jkl;"
and one of them is marked with a slash (or anything) behind it
like "cheese" in this case
@HamZa good to hear that :)
so I'd like to select the string(s) which is/are marked
I thought about lazy operator '?'
because it I do
".*"
it simply selects everything
HamZa
@Isti115 marked with? What's the output you want ?
Isti115
".*?" selects strings in pairs of quotes
I'd like either "cheese" of cheese
HamZa
@Isti115 So you mean a quoted string that must be followed by a forward slash ?
Isti115
20:40
so I thought I'd just do
".*?"/
but that for some reason selects other strings before the marked one
@HamZa yes, exactly
HamZa
@Isti115 What language are you using ?
CSᵠ
\S+(?=\/)
HamZa
@CSᵠ to the point :P
Isti115
I'm doing it in sublime, so it's perl regex if you are asking about this
CSᵠ
lol
fast and dirty :)
Isti115
20:41
I'm trying that one right now
CSᵠ
for more, please learn regex :D
HamZa
(?<=").*?(?="\/)
Isti115
and that WORKS :D:D:D
CSᵠ
((['"])\w+\2)(?=\/)
maybe
didn't check that
Isti115
wow, I'm really confused here!
CSᵠ
20:44
?
HamZa
@CSᵠ
where them quantifiers :D ?
Isti115
just trying to understand all this stuff
(yes, I'm a beginner)
CSᵠ
@HamZa ty, fixed, AGAIN :)))
HamZa
welcome
CSᵠ
@HamZa lol... that pinned message is a bit down...
Isti115
20:45
thank you guys :)
HamZa
@Isti115 welcome, you might try
regex101.com
and
rick.measham.id.au/paste/explain.pl
Isti115
though I already knew about the "ends in" operator, I didn't think about that
wow :D
that's a useful site!
HamZa
@CSᵠ Which one ? I got a lot of rooms open hehe
Isti115
also, by "ends in" I meant positive lookahead
also, I'm curious why my original try didn't work?
If you could enlighten me about that too I'd be more than happy :)
".*?"/
was what I though of
HamZa
@Isti115 Have you tried escaping the forwardslash ?
Isti115
20:54
I'm new understand the dirty solution and I'd like to add one more thing to the challenge: there can be whitespace between the quotes
yes, I tried, but it didn't work, also I've read that it doesn't need to be escaped in perl regex:
boost.org/doc/libs/1_47_0/libs/regex/doc/html/boost_regex/…
HamZa
@Isti115 "\S" means match a non-white space. So it won't match a space
Isti115
yes, I know (I just didn't think at first)
that's why I'm asking for a solution that is compatible with strings that contain whitespace
only if you want the challenge though
it isn't really needed :)
"I'm new understand"
wow, I really messed that one up...
*:"I'm now starting to understand"
HamZa
17 mins ago
, by
HamZa
(?<=").*?(?="\/)
Isti115
ugh, sorry! I must be blind, missed that one...
but!
it doesn't work!
regex101.com/r/cO5cT4
HamZa
@Isti115 Ah facepalm,
regex101.com/r/vG2wQ1
Isti115
21:03
Yes!
I need to get on your level :D
How many years of experience do you have?
Thank you guys very much!
HamZa
@Isti115 experience ? Can't recall, I'm a student :)
Isti115
me too :D
I'm 17
HamZa
Well I do have experience. Let's just say I've got 1year experience in regex from stackoverflow
Isti115
I've done quite some programming, but I've never relied on regex much
HamZa
See that first starred message ? There's a link in there which has good links to other posts
Isti115
21:07
are you planning on participating in google codejam?
HamZa
I was, but I got a lot on my head lately ...
Isti115
I see the message, but I won't start reading it right now, because it's 23:09 right here and I have school tomorrow...
but thanks for the info :)
Good bye!
HamZa
@Isti115 cyaaa :)
« first day (389 days earlier)
← previous day
next day →
last day (3403 days later) »
all rooms
Transcript for
Mar
31
Apr '14
1
Apr
2
RegEx - Regular Expressions
Discuss about Regular Expressions. Learn at:
Regular-Expressio...
1
matching
pcre
posix
regex
regex-fu
regexp
search-and-replace
join this room
about this room
00:00
06:00
12:00
18:00
all times are UTC
site design / logo © 2024 Stack Exchange Inc;
legal
mobile