Regex and Groups
-
Can I specify a default value for a group in my regular expression so that if the group does not match I shall use that default value. I can do by checking the returned groups in my own code But I want to know if this could be done using the Regex.match or somefin like that
o O º(`'·.,(`'·., ☆,.·''),.·'')º O o° »·'"`»* *☆ t4ure4n ☆* *«·'"`« °o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°
-
Can I specify a default value for a group in my regular expression so that if the group does not match I shall use that default value. I can do by checking the returned groups in my own code But I want to know if this could be done using the Regex.match or somefin like that
o O º(`'·.,(`'·., ☆,.·''),.·'')º O o° »·'"`»* *☆ t4ure4n ☆* *«·'"`« °o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°
It seems not, and rightly so, the RegEx shouldn't return any characters that weren't in the original string. But, yeah, it would be handy in certain cases.