rfc:native_regular_expressions
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:native_regular_expressions [2014/08/14 01:35] – Jotting my thoughts down. bishop | rfc:native_regular_expressions [2014/08/15 13:34] – bishop | ||
---|---|---|---|
Line 6: | Line 6: | ||
* First Published at: http:// | * First Published at: http:// | ||
+ | FIXME FIXME FIXME | ||
Jotting my ideas down here. Move along. Maybe called " | Jotting my ideas down here. Move along. Maybe called " | ||
New built-in " | New built-in " | ||
+ | < | ||
syntax := re < | syntax := re < | ||
fence-post := <any character> | fence-post := <any character> | ||
Line 15: | Line 17: | ||
regex-modifiers := whatever is valid for modifiers | regex-modifiers := whatever is valid for modifiers | ||
semic := ';' | semic := ';' | ||
+ | </ | ||
Example: | Example: | ||
+ | < | ||
$regex = re /^\w+$/i | $regex = re /^\w+$/i | ||
preg_match($regex, | preg_match($regex, | ||
ereg_match($regex, | ereg_match($regex, | ||
+ | </ | ||
+ | ====== Motivation ====== | ||
+ | * Regex are integral to modern info processing | ||
+ | * Quoting them inside strings is hard: you have the quote character to deal with, plus the fence post | ||
+ | * Other languages have re built in | ||
- | Motivation | + | ====== Goals ====== |
- | * Regex are integral | + | * Reduce effort of code authors |
- | * Quoting them inside strings is hard: you have the quote character to deal with, plus the fence post | + | * Compile time verification of regex (benefit?) |
- | * Other languages have re built in | + | |
- | Goals: | + | ====== Non-goals ====== |
- | * Reduce effort of code authors to quote regex properly | + | * Adding a new regex class, with methods like $re-> |
- | * Compile time verification of regex (benefit?) | + | |
- | Non-goals: | + | ====== Similar implementations ====== |
- | * Adding a new regex class, with methods like $re-> | + | * Javascript: http:// |
+ | * Python: https:// | ||
+ | * Comparison: http:// | ||
- | Similar implementations: | + | ====== Discussions ====== |
- | * Javascript: http://mrrena.blogspot.com/2012/ | + | * https://news.ycombinator.com/item? |
- | * Python: https://docs.python.org/3/howto/regex.html | + | * http://stackoverflow.com/questions/25310999/what-is-the-maximum-length-of-a-regular-expression |
- | * Comparison: http:// | + | |
- | Discussions: | ||
- | https:// | ||
+ | ---- | ||
This is a suggested template for PHP Request for Comments (RFCs). Change this template to suit your RFC. Not all RFCs need to be tightly specified. | This is a suggested template for PHP Request for Comments (RFCs). Change this template to suit your RFC. Not all RFCs need to be tightly specified. |
rfc/native_regular_expressions.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1