RSS feed [root] /misc /weblog




login:

password:

title search:




 


Fri Sep 06 12:56:50 GMT 2019

regex



Short tips of regex - http://immike.net[..]know-to-become-a-regular-expression-pro/

Let regex more readable - http://martinfowler.com/bliki/ComposedRegex.html

Useful Regular regression

Match username - /^[a-zA-Z0-9_]{3,16}$/
Matching an XHTML/XML tag - {]*>(.*?)}
Matching an XHTML/XML tag with a certain attribute value (e.g. class or tag) - {]*attribute\\s*=\\s*(["'])value\\\\1[^>]*>(.*?)}
Matching a URL - (a very long one... refer to article...)

http://immike.net[..]ssions-every-web-programmer-should-know/

The danger of bad regex - http://andreas.haufler.info[..]o-kill-java-with-regular-expression.html http://www.regular-expressions.info/catastrophic.html http://vladmihalcea.com/2014/02/24/the-regex-that-broke-a-server/

You have a string “BEFOREAFTER”. If this string has a ‘x’ in it, you want to capture everything before the ‘x’, else you want to capture the whole string. So,
”BEFOREAFTER” gives “BEFOREAFTER”
”BEFORExAFTER” gives “BEFORE”
http://octodecillion.com[..]apture-with-optional-delimeter/#solution

http://www.infoq.com[..]/regular-expressions-introduction-part01

https://www.guru99.com/linux-regular-expressions.html

https://www.janmeppe.com/blog/regex-for-noobs/


(google search) (amazon search)
second
download zip of files only