Regular Expressions: Difference between revisions
Jump to navigation
Jump to search
m (→Useful RegEx: Minor edit) |
(Added "Random Examples") |
||
Line 10: | Line 10: | ||
| <code><nowiki> \A(\w|-)+ </nowiki></code> | | <code><nowiki> \A(\w|-)+ </nowiki></code> | ||
|} | |} | ||
== Random Examples == | |||
* '''Filename''' | |||
** <code> \d{4}-[A-Za-z]{3}-Week\d{1}.log </code> | |||
** Example matches... | |||
*** 2010-Feb-Week4.log | |||
*** 2009-Dec-Week2.log | |||
*** 1234-aBc-Week0.log |
Revision as of 12:40, 22 March 2010
Useful RegEx
Matches | Expression |
---|---|
IP Address | ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\b
|
Hostname (no domain) | \A(\w|-)+
|
Random Examples
- Filename
\d{4}-[A-Za-z]{3}-Week\d{1}.log
- Example matches...
- 2010-Feb-Week4.log
- 2009-Dec-Week2.log
- 1234-aBc-Week0.log