« first day (531 days earlier)      last day (3261 days later) » 

11:00 AM
@zx81 That's a really interesting standpoint. I've had minds of providing regex query for users, but I've came to a conclusion that it's quite very difficult to programmatically figure out if a regex is a "bad regex".
Of course, a possibility is to halt the operation if it takes too long, like regex101 is already doing, but for querying large DBs, that's not viable.
... Is it possible to compose a regex to validate if a regex is a bad regex (assuming we validate the pattern is compilable beforehand)?
 
11:19 AM
Identifiying "bad regex" is a difficult task. We need to start with the definition of "bad regex"? A wrong regex? A regex that has a syntax issue? A regex that takes a lot of time?
I can't see how you might detect catastrophic backtracking issues
 
A common symbol is the b+b+ (terrible) vs bb+ (or even b{2,}).
 
Well there's also ((someregex)quantifier)quantifier
but in some cases this might be valid
 
or even (b)(?1)+...
 
 
2 hours later…
12:57 PM
Hello =)
 
Hey there
 
I'm trying to clean up some comments, removing code and stuff... Now i'm stuck how to remove nested tags... I saw some answer but none helped (I'm being slow lately xD)
 
I thought the whitespace character was  ?
This might help you, but I'm not sure.
I'm not really understanding what you're trying to do. :S
 
hmm, what an ugly regex lol
@Unihedron It works fine with your exmaples, but it mises the last one in mine: regex101.com/r/zU9qV6/7
bellow the XXXXXXXXXXXXXX
 
1:19 PM
Ah, that last one is not nested.
The OP question was "I'm trying to find all the nested tags, here are some examples:
I want to catch: <a><a></a></a>
I don't want to catch <a></a><a></a>"
Going to slightly modify that.
Maybe you want this: regex101.com/r/zU9qV6/8
 
Oh, it's implied I guess ^^
 
Oh and you can use (?R) : regex101.com/r/zU9qV6/9
 
nice, gonna save this one =)
 
Glad I could help!
 
One last thing If I may
sometimes the < and > are printed as &lt; and &gt;
How to modify your pattern to match them too ?
If it's too complicated to do, then it's fine, not important, the first pattern is more important for me
 
1:32 PM
That's a really interesting problem, I'm trying to put together one.
Huh? It doesn't work... regex101.com/r/zU9qV6/10
Oh! I see what I'm missing now.
This one puts it back on a line: regex101.com/r/zU9qV6/12
 
1:48 PM
Perfect, thanks a lot for your time <3
 
lol bye
I stole the roll technique from here: stackoverflow.com/a/25352148
(?:<|&lt;)((?:(?![ \>]|&gt;)&?[^& \>])++) ?(?:(?!>|&gt;)&?[^>&]*+)*+(?:>|&gt;)(?:(?:(?!<|&lt;)&?[^<&]*+)*+|.*?(?R).*?)(?:<‌​|&lt;)\/ ?\1(?:>|&gt;)|(?:<|&lt;)(?:(?![ \>]|&gt;)&?[^& \>])++ ?\/(?:>|&gt;)
 
 
1 hour later…
3:10 PM
@Unihedron haha check this: regex101.com/r/zU9qV6/13
catastrophic backtracking
xD
 
XD
What's different?
 
no idea... it even has less content than the previous example
omg
it's version 12 and 13 in the link
copy the text from one, and search it with your browser (ctrl+f) in the other
 
wait... what?
...... ???
 
hmm, maybe the tool is going crazy
 
(?:<|&lt;)((?:(?![ \>]|&gt;)&?[^& \>])++) ?(?:(?!>|&gt;)&?[^>&]*+)*+(?:>|&gt;)(?:(?:(?!<|&lt;)&?[^<&]*+)*+|.*?(?R).*?)(?:<‌​‌​|&lt;)\/ ?\1(?:>|&gt;)|(?:<|&lt;)(?:(?![ \>]|&gt;)&?[^& \>])++ ?\/(?:>|&gt;)
(?:<|&lt;)((?:(?![ \>]|&gt;)&?[^& \>])++) ?(?:(?!>|&gt;)&?[^>&]*+)*+(?:>|&gt;)(?:(?:(?!<|&lt;)&?[^<&]*+)*+|.*?(?R).*?)(?:<‌​|&lt;)\/ ?\1(?:>|&gt;)|(?:<|&lt;)(?:(?![ \>]|&gt;)&?[^& \>])++ ?\/(?:>|&gt;)
/(?:<|&lt;)((?:(?![ \>]|&gt;)&?[^& \>])++) ?(?:(?!>|&gt;)&?[^>&]*+)*+(?:>|&gt;)(?:(?:(?!<|&lt;)&?[^<&]*+)*+|.*?(?R).*?)(?:<|&lt;)\/ ?\1(?:>|&gt;)|(?:<|&lt;)(?:(?![ \>]|&gt;)&?[^& \>])++ ?\/(?:>|&gt;)/sg
1st Alternative: (?:<|&lt;)((?:(?![ \>]|&gt;)&?[^& \>])++) ?(?:(?!>|&gt;)&?[^>&]*+)*+(?:>|&gt;)(?:(?:(?!<|&lt;)&?[^<&]*+)*+|.*?(?R).*?)(?:<|&lt;)\/ ?\1(?:>|&gt;)
(?:<|&lt;) Non-capturing group
1st Alternative: <
< matches the characters < literally
2nd Alternative: &lt;
&lt; matches the characters &lt; literally (case sensitive)
/(?:<|&lt;)((?:(?![ \>]|&gt;)&?[^& \>])++) ?(?:(?!>|&gt;)&?[^>&]*+)*+(?:>|&gt;)(?:(?:(?!<|&lt;)&?[^<&]*+)*+|.*?(?R).*?)(?:<‌​|&lt;)\/ ?\1(?:>|&gt;)|(?:<|&lt;)(?:(?![ \>]|&gt;)&?[^& \>])++ ?\/(?:>|&gt;)/sg
1st Alternative: (?:<|&lt;)((?:(?![ \>]|&gt;)&?[^& \>])++) ?(?:(?!>|&gt;)&?[^>&]*+)*+(?:>|&gt;)(?:(?:(?!<|&lt;)&?[^<&]*+)*+|.*?(?R).*?)(?:<‌​|&lt;)\/ ?\1(?:>|&gt;)
(?:<|&lt;) Non-capturing group
1st Alternative: <
< matches the characters < literally
2nd Alternative: &lt;
&lt; matches the characters &lt; literally (case sensitive)
If you want, move those messages to trash... But I have no idea what differences there are in the two demo.
The regex101 devs should totally drop the regex101 engine and try jQuery.
 
3:46 PM
I tweeted him... i'll keep u updated if I hear from him xD
 
 
1 hour later…
4:49 PM
Hi Guys. I have a pretty simple Regex to get names from the string: \w+
 
@Bryuk Good for you
 
I need exlude ' symbol, cause Name could contain ' inside like : Jhon D'amico
Could you help me with that? :)
 
My string could contain any characters and symbols. I need to get all words and number except all other symbols. But ' could be in the name
For example, string could be: Sup. Agetn007 : Jhon, D'amico
 
Can't you like... Use a character class [\w']+
 
4:55 PM
I need split this to: Sup Agent007 Jhon D'amico
[\w']+ - this gives me only Sup
 
yep... g for global . My bad
:)
THANKS! You're awesome!
saved my time, which I don't have now...
 
 
5 hours later…
9:49 PM
yes!! finally found a thing that makes .net's regex engine suck: recursion (ty @HamZa && @zx81 )
 
10:00 PM
recrusion?
 
@CSᵠ You didn't know that C# doesn't have recursion?
 
welcome
 
@Jerry nope
I don't use that engine
 
10:23 PM
@CSᵠ Yes, recursion is missing. In the same basket, subroutines—which is really a shame as the .NET engine is otherwise fabulous. Does anyone know how to get in touch with the regex folks at µSft? I have been thinking that I would love to start a lobbying effort for more features. Recursion has been in PCRE since Feb 2000! Balancing groups are great but do not make up for the lack of recursion and subroutines.
 

« first day (531 days earlier)      last day (3261 days later) »