This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Old posts that have not been replied to for several years.
EEggy
Op
Posts: 122 Joined: Thu Sep 26, 2002 11:46 pm
Post
by EEggy » Wed Dec 31, 2003 11:17 pm
Hi,
could you please help me to write the regexp for the following?
if nick has just one digit at the end? like tim9, kim4..etc?
[regexp {.*([0-9]){1,}.*} $nick]}
thanks & happy new year
EEggy
strikelight
Owner
Posts: 708 Joined: Mon Oct 07, 2002 10:39 am
Contact:
Post
by strikelight » Thu Jan 01, 2004 2:08 am
maybe something like:
of course... you could always just use string functions like string index, string is... etc...
EEggy
Op
Posts: 122 Joined: Thu Sep 26, 2002 11:46 pm
Post
by EEggy » Thu Jan 01, 2004 2:49 am
Thank you much, it worked.
but it also works for "t1s3t2" as well, how do i make sure, it should just check the only last number in the nick, in this example last number is 2, but also 1 and 3 are there too, so it should ignore this type..
thanks again
EEggy
strikelight
Owner
Posts: 708 Joined: Mon Oct 07, 2002 10:39 am
Contact:
Post
by strikelight » Thu Jan 01, 2004 7:10 pm
I haven't tested this thoroughly but it may be what you're after...
Code: Select all
regexp {^[^0-9]*([0-9]$){1}} $nick
else... see the manual page entry for re-syntax.
EEggy
Op
Posts: 122 Joined: Thu Sep 26, 2002 11:46 pm
Post
by EEggy » Thu Jan 01, 2004 10:59 pm
Thanks again, perfect.
EEggy
EEggy
Op
Posts: 122 Joined: Thu Sep 26, 2002 11:46 pm
Post
by EEggy » Sun Jan 11, 2004 2:57 pm
Hi strikelight <- regexp's expert.
could you please help me again? advance thanks
regexp {^[^0-9]*([0-9]$){1}} $nick works perfect if nick has number at the end.
if nick has slash(\), breakets ] or [ , or ' at the end, like the above for numbers.
like -> test\ or test[ or test] or test`
and if underscore at the end or start, like test_ or _test
thanks
EEggy