« first day (498 days earlier)      last day (3294 days later) » 

8:38 AM
's regex engine is really basic. Not many features in there. I always check in the playground whether it works or not.
 
 
8 hours later…
4:48 PM
hi! is anyone here?
 
It depends on where you mean by "here". I may be on a distinct planet, Earth @ Alpha Centauri.
 
ok nice :P
i need some help
 
Hi :P Please ask.
 
i have this input: pastebin.com/9pYdbzU9
and try to execute this command line regex
 
Are you parsing HTML with Regex?
Every time a programmer attempts to parse HTML or XML with Regex, a velociraptor eats their power cord.
But please continue.
 
4:53 PM
perl -i.bakk -p -e "s/<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgco
lor=\"#CCCCCC\">.*?<td class=\"tt1\">Ru-Brd<\/td>.*?previous.gif.*?\/td><\/tab
le>/ /gs"
sorry i was trying to get it from the command line
the thing is that i cannot make active pearl
in windows do multiline regex replace
for single line everything works ok
 
@HamZa how's it going man
 
Any ideas?
i have tested the regex with RegexBuddy
and with online tools
and matches and replaces perfectlly
i even converted the files that i want to Unix command line endings
 
@hwnd Yo, really tired and broke. It's really hot today, I had to work the whole day and it's ramadan so I didn't drink...
 
to be sure
 
Damn, need me to come buy you a beer
 
4:56 PM
I don't think this matches for me because of the newline in regex.
 
@hwnd lol, I don't drink :)
but I bought a lot of juice for tonight :D
@hwnd how are you doing?
 
You do ramadan?
 
well it is due to the bad copy pase
remove the new lines
 
I'm doing good man, glad its the weekend
 
5:00 PM
cmd just displayes them that way
because it cant fit
 
@hwnd yes, I fast
@hwnd nicu
 
@Unihedron here it is clean:
can somebody convert it to a perl call
i need to make a batch search and replace
 
5:32 PM
@TheArtist why are you trying to parse HTML with regex, especially in Perl?
 
well i just wanted to make the same search and replace in looooooots of files, and sed in windows is kinda buggy... So it was the next option
do you know how can i convert the above regex in an inline one like

perl -i -p -e "....
 
perl -i -pe 's/pattern/replacement/g' file
 
well the thing is that the regex is targetting multiline
content
 
perl -0777 -i -pe 's{pattern}{replacement}g' file
 
what does the -0777 do
 
5:39 PM
Using the -0 option puts Perl in paragraph mode and the special value 0777 puts Perl into file slurp mode.
 
still no luck
I DID IT!
Well it still needed s for dot match all
But thanks for the tip
on the slurp mode
 
Hooray!
 
 
3 hours later…
8:35 PM
@HamZa
 
@hwnd pong
 
Is there a way to get a lookahead to stop at the position it first matches?
I've tried boundaries but no luck, I'm trying to make it stop at the position before the 092
 
@hwnd Something like this regex101.com/r/yC9aH9/3 ?
 
Exactly what I was missing..
 
@hwnd Well, I don't know what's the use-case but it could be simplified to [0-9]{1,3}$ :P
 
8:41 PM
0
Q: preg_split and multiple patterns

Paul WilliamsI have following bit of php code using regular expressions: $result_from_pull = "T601092"; if(preg_match("/^[A-Za-z0-9]{2,6}[0-9]{1,3}$/", $result_from_pull)) { echo "We found a \"valid\" UFS key."; } What I'm trying to do is split the string into two parts. The first part would match the...

Hey wanted for example T601092 split into T601 and 092, but if that was the case, he needs to change his beginning pattern from {2,6}
 
@hwnd A rather useless attempt to use preg_split since preg_match would do the job...
 
I agree
 
I guess the magic you did with \K and (?=) is what he's looking for
 
Actually I figured out a way around it to get his desired result.
 
@hwnd Nice use of the reluctant quantifier
 
 
1 hour later…
10:19 PM
I'm getting too old... or stupid :<
Basically the question is how to mimic the negative lookahead... I tried many combination with noo success... ofc :/
Not sure if we can use the positive lookahead... tricky question :>
 
11:21 PM
Yo,
I'm coming for the rescue
A regex that might interest you
Don't ruin the fun by asking me for a clue
but if you do, i might explain a few
it's on regex101 the best site for some regex-fu
http://regex101.com/r/lC7kE9/2
^ btw, I think those students are searching for some theoretical computer science regex
 
Hey mate... I hope you're doing fine :)
Oh my... another scary regex xD
I'll study it and will get back to you =)
and do they have a list for such twisted regexes ?
 
@Enissay a list?
and who is "they"?
 

« first day (498 days earlier)      last day (3294 days later) »