Welcome Guest, Not a member yet? Register   Sign In
Regex help!
#9

[eluser]xwero[/eluser]
the question mark is used for string that can be there or not like
Code:
/_or_?(higher|lower)?/
when used after + or * the catching of the group is less aggressive.

Another good to know option with the question mark is ?: before a group like
Code:
/(?:[a-z]*)_(higher|lower)/
$1 will be either higher or lower and not the first group. If you use regex to match something without the need of returning use that syntax for better performance.

If you want a site with information about regex go to http://www.regular-expressions.info/


Messages In This Thread
Regex help! - by El Forum - 03-25-2008, 01:41 AM
Regex help! - by El Forum - 03-25-2008, 01:59 AM
Regex help! - by El Forum - 03-25-2008, 02:04 AM
Regex help! - by El Forum - 03-25-2008, 02:06 AM
Regex help! - by El Forum - 03-25-2008, 02:25 AM
Regex help! - by El Forum - 03-25-2008, 02:27 AM
Regex help! - by El Forum - 03-25-2008, 11:28 AM
Regex help! - by El Forum - 03-26-2008, 10:10 AM
Regex help! - by El Forum - 03-26-2008, 10:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB