« first day (1388 days earlier)      last day (704 days later) » 

6:15 AM
I do not know much about regular expressions used in SEDE/SQL after LIKE. Basically the only thing I've used so far was something like [^a-zA-Z] - based on advice given here. For example, in a query like this one.
When I search for posts containing something like projecteuclid.org/DPubS?service=UI&version=1.0&verb=Display&handle= - should I be worried that ? or & could possibly be interpreted as a regex?
Here is an example of such query. I used several similar queries in this post: Can (and should) Project Euclid links be replaced in bulk?
However, looking at some documentation online, it seems that in T-SQL the only things with a special meaning are %, _, [] and [^].
 
6:32 AM
SQL patterns are pretty simple/dumb (and rightfully so; you don't want to do a full table scan with a complicated regex on every row). When in doubt, I usually test my query on a single post I expect to match. That's better than to rely on specifications which may change over different versions.
 
6:43 AM
@Glorfindel Yes, testing is certainly good idea. (And in this particular case, the returned post included that URL.)
I was mainly curious whether it is possible that if the string contains characters such as questionmark or ampersound, then the results might include some other things - not only the exact character.
For example, since [] has special meaning, if I want to find entries that have entries such as [here], I would have to modify the search string. (Of course, this would be only in PostHistory which contains MarkDown - IIRC Posts.Body contains HTML.)
 
@Martin No, not really. Reiterating what Glorfindel said: There is no out-of-the-box RegEx engine in SQL Server so you can't accidently invoke a regex match. The Like expression is more a globbing engine.
As for your concern about the content of a field being used as the pattern: Unless you get the order wrong or base your pattern on a field, the special characters in the field you want to match never influence the pattern the engine is going to use.
[Posthistory.text] like '%s[o,a]mething% will never cause issues if text contains brackets or question marks, percent characters.
 
0
Q: SEDE favorite button fails silently when not logged in

GlorfindelI was trying to bookmark/favorite this interesting Proof of Concept on the Stack Exchange Data Explorer, but clicking the favorite button did not do anything. Of course, I should have realized SEDE logged me out (but it's Monday morning here, blame the lack of coffee), but I'd expect at least a ...

 
But if - for some reason - I wanted to find the exact string [here], then like '%[here]% would be a wrong way to go, I suppose.
 
Yeah, you need to escape the [ like so [[].
so %[[]here]%
 
6:58 AM
Thanks for the response (and for your time) to both of you!
 
 
2 hours later…
9:10 AM
I meant to say random test - rather than random text. :-)
 

« first day (1388 days earlier)      last day (704 days later) »