[opensource] regex help!

Brian Swaney swaney.29 at osu.edu
Fri Feb 22 17:11:44 EST 2008


There is a potential for other, rarer characters. I know of at least 1 
case where someone's OSU username, which is not in the standard format 
or magnus, contains the '+' character. Of course, it may be better to 
simply make a workaround for administrators.

-Brian Swaney

NOTE: If you respond to this e-mail, please use your OSU-provided address, 
unless otherwise specified. In order to block spam, any e-mails sent here 
without an osu.edu or xxx.ohio-state.edu domain will not be received and 
the sender can expect returned mail. If you do not have an OSU address, I 
have probably already added you to a "trusted senders" list, and you 
should be able to continue communications as normal. In the event that 
you do not have an OSU address, and cannot reach me, please send an e-mail 
to my address of Lavagolemking at aol.com letting me know who you are, what 
you need to reach me for, and what addresses you're using so I can unblock 
them.

Please also note that sending OSU mail from a GMail account will show up
as the GMail account. If the GMail account is not on a trusted senders
list, even if the From: address is trusted, the message will not be
delivered. If you encounter this, please send your first e-mail from
https://webmail.osu.edu/ and in that e-mail tell me the GMail address you
are using, and I will whitelist it. All following messages may then be 
sent from either the GMail or OSU account. Sorry for any inconvenience
this may have caused.



William (Bill) E. Triest III wrote:
> All,
>
> Sorry for replying to my own message. I made an error in my first 
> post, so I thought I should clarify it.  Previously I said that the 
> first grouping would allow numbers, but that was only true for the 
> perl regex.  I also realized I didn't explain why it matched very well 
> nor did I point out that it would actually match any string containing 
> that substring.
>
> The problem with what I've provided so far is that it could match 
> 12baronda.2foo because it contains a matching substring.   In perl you 
> could fix this by perpending the regex with ^ and ending it with $ and 
> according to wikipedia that's true for POSIX regex's but it may not be 
> the case for all regex implementations.
>
> Generically:  [a-zA-Z]+\.[0-9]+
>
> Also, I think some lastname.n's include hyphens, so you'll want to add 
> them into the regex if that's really what you are trying to match.  
> Also, depending on what you're trying to do with this, I think there 
> are OSU identifiers can take other forms, although it rare (I know 
> magnus definately can, but I thought some of the newer ones could 
> also). If that's what you are trying to match I would suggest trying: 
> [a-zA-Z\-]+\.[0-9]+
>
> I'll break it down to explain:
>
> [a-zA-Z\-]+
> [] are grouping, and a-z says lowercase letters, A-Z upper case 
> letters  I'm not positive on the \- for including the literal hyphen, 
> but try it.  If you only want lowercase letters then just put [a-z] 
> The + at the end tells it to have one or more matching in that group
>
> \.  (backslash then a period) means period (backslash to escape it so 
> that its a literal period since period has a special meaning in regex's)
> [0-9]+ is another character grouping, but this time only digits.  
> Again the + means one or more numbers
> tcut.
>
>
> Hope this helps and sorry for multiple posts,
> Bill
>
> Silas Baronda wrote:
>> I'm looking for a regex that will match say baronda.2 so just
>> string.xxxx x's being integers.
>> _______________________________________________
>> Opensource mailing list
>> Opensource at cse.ohio-state.edu
>> http://mail.cse.ohio-state.edu/mailman/listinfo/opensource
>>   
>
> _______________________________________________
> Opensource mailing list
> Opensource at cse.ohio-state.edu
> http://mail.cse.ohio-state.edu/mailman/listinfo/opensource


More information about the Opensource mailing list