Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

regex

Name: Anonymous 2014-02-02 19:48

is it possible to create a regular expression that matches all regular expressions?

Name: Anonymous 2014-02-02 20:05

Does a bear shit in the woods?

Name: Anonymous 2014-02-02 20:37

>>2
I don't know you tell me

Name: Anonymous 2014-02-02 20:39

.*

Name: Anonymous 2014-02-02 20:58

/.+/

Name: Anonymous 2014-02-02 21:50

>>5,4
How about something that matches regexes exclusively.

Name: Anonymous 2014-02-02 21:56

>>6
No, because the set of regexes overlaps with the set of matchable patterns.

Name: Anonymous 2014-02-02 22:15

>>6
/a/ is a regex. So are /aa/, /aaa/ and /aaaa/.

If you want to filter out the alphanumeric-only regexps then do so.

Name: Anonymous 2014-02-02 22:42

\ is not a valid regex. What now?

Name: Anonymous 2014-02-03 1:09

>>9
escape it

Name: Anonymous 2014-02-03 1:56

The set of strings of balanced parens is not regular. So since you can write expressions like, (add|eijeg)|hihih, the ability to recognize balanced parens is required, and the set of all regular expressions is not regular. Therefore such a regular expression does not exist.

Name: Anonymous 2014-02-03 2:47

>>10
Not the fucking point. .* doesn't excluseively match all regexes because .* matches "\" but is not not a valid regex.

Suck my cock

Name: Anonymous 2014-02-03 2:59

>>12
/\/.*\//g

Name: Anonymous 2014-02-03 9:31

>>11
That was mathematician quality!

Name: Anonymous 2014-02-03 17:34

If the requirement is to create a regex that matches only regexes and not text, then it is impossible, since some (reasonably) valid text can be a (reasonably) valid regex. For example, "a".

Name: Anonymous 2014-02-11 4:53

OP said nothing about not matching anything other than regex, so /.+/

Don't change these.
Name: Email:
Entire Thread Thread List