I wish I was as smart as these people.
Regex that only matches itself
11–20 of 66 posts
Re: Regex that only matches itself
#12I think I might be missing something. Wouldn't something like "a" be a valid 1-byte regular expression that only matches instances of "a"?
Re: Regex that only matches itself
#13I think I might be missing something. Wouldn't something like "a" be a valid 1-byte regular expression that only matches instances of "a"?
Your regex is actually /a/ which does not match the string "/a/".
Re: Regex that only matches itself
#14Re: Regex that only matches itself
#15Re: Regex that only matches itself
#16Re: Regex that only matches itself
#17I think I might be missing something. Wouldn't something like "a" be a valid 1-byte regular expression that only matches instances of "a"?
> NOTE, delimiters must be included Your regex is actually /a/ which does not match the string "/a/".
Edit: looks like slashes weren't even used in the example.
Re: Regex that only matches itself
#18I wish I was as smart as these people.
Everybody is a Genius. But if you judge a fish by
its ability to climb a tree, it will live its whole
life believing that it is stupid.
- Albert EinsteinRe: Regex that only matches itself
#19Earlier quoted context omitted.
> NOTE, delimiters must be included Your regex is actually /a/ which does not match the string "/a/".
I would say that adding slashes is quite arbitrary constraint, and it is really language specific syntax that is limited to minority of languages (I believe it was introduced in Perl). If you do regexp in Java, Python, C you don't use slashes. Edit: looks like slashes weren't even used in the example.
Re: Regex that only matches itself
#20I wish I was as smart as these people.
Everybody is a Genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid. - Albert Einstein