List Info

Thread: grab last n characters from a string




grab last n characters from a string
user name
2006-04-25 18:18:02
.*(.)\Z

will get u the last 6 chars from

12dh5jklkspoAb789Nm5

as group 1

next apply regex to group 1 ('789Nm5') as

(.)(.)\Z

and replace with 

"$1"-"$2"

the result will be:

"789"-"Nm5"


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---

grab last n characters from a string
user name
2006-04-25 18:26:07
cool stuff.....   thank you for your help


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---

grab last n characters from a string
user name
2006-04-27 17:40:03
hi, Sergei Z

why r u using "z"  at the  last of regax, i know
the meaning of it that
it will give the only last 6 charcters of the word.

in which language r u using this syntex i mean
"z", i am using regax in
php there is a "$" for the same purpose.

thanks


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )