Anyone Know Regular Expressions? - Fantasy Baseball Cafe 2014 Fantasy Baseball Cafe
100% Deposit Bonus for Cafe Members!

Return to General Talk

Anyone Know Regular Expressions?

Moderator: Baseball Moderators

Postby Amazinz » Tue May 08, 2007 11:58 am

That's true it would. But if the regex is not working as expected .* is most likely the culprit. He's a greedy little bastard. :-D
Image
Maine has a good swing for a pitcher but on anything that moves, he has no chance. And if it's a fastball, it has to be up in the zone. Basically, the pitcher has to hit his bat. - Mike Pelfrey
Amazinz
Mod in Retirement
Mod in Retirement

User avatar
CafeholicFantasy ExpertCafe WriterCafe RankerMock(ing) DrafterEagle EyeWeb SupporterPick 3 Weekly WinnerSweet 16 SurvivorLucky Ladders Weekly Winner
Posts: 18800
Joined: 16 Mar 2004
Home Cafe: Baseball
Location: in Canada, toughening up figure skaters

Postby StlSluggers » Tue May 08, 2007 11:59 am

Amazinz wrote:That's true it would. But if the regex is not working as expected .* is most likely the culprit. He's a greedy little bastard. :-D

Greedy little bastard?

Have you been reading the same book I have? :-b
StlSluggers
Hall of Fame Hero
Hall of Fame Hero

User avatar
CafeholicCafe WriterMock(ing) DrafterWeb Supporter
Posts: 14716
Joined: 24 May 2004
Home Cafe: Baseball
Location: Parking in the gov't bldg @ 7th and Pine. It's only $3.00 on game day!

Postby Amazinz » Tue May 08, 2007 12:00 pm

Math humor. !+)
Image
Maine has a good swing for a pitcher but on anything that moves, he has no chance. And if it's a fastball, it has to be up in the zone. Basically, the pitcher has to hit his bat. - Mike Pelfrey
Amazinz
Mod in Retirement
Mod in Retirement

User avatar
CafeholicFantasy ExpertCafe WriterCafe RankerMock(ing) DrafterEagle EyeWeb SupporterPick 3 Weekly WinnerSweet 16 SurvivorLucky Ladders Weekly Winner
Posts: 18800
Joined: 16 Mar 2004
Home Cafe: Baseball
Location: in Canada, toughening up figure skaters

Postby StlSluggers » Tue May 08, 2007 12:03 pm

Amazinz wrote:Math humor. !+)

I guess that it's bad that got it. :-B

I wasn't worried about the "greediness," but I'll try it with the preceeding \b just to see what I get.

I'm worried I'm double-counting because I can't verify my totals manually. In fact, my manual calculations pale in comparison to the totals I'm getting in these queries. That would be very bad, but that's a separate issue right now. First, I need to get this to a point where I'm 100% sure that I'm pulling the right crap.

Thanks for the help, A!
StlSluggers
Hall of Fame Hero
Hall of Fame Hero

User avatar
CafeholicCafe WriterMock(ing) DrafterWeb Supporter
Posts: 14716
Joined: 24 May 2004
Home Cafe: Baseball
Location: Parking in the gov't bldg @ 7th and Pine. It's only $3.00 on game day!

Postby Coppermine » Tue May 08, 2007 12:10 pm

I know some irregular expression, but I can only say them in an Australian accent
If you're a battery, you're either working or you're dead....
Coppermine
Hall of Fame Hero
Hall of Fame Hero

User avatar

Posts: 8840
Joined: 6 Sep 2005
Home Cafe: Baseball
Location: Pennsyltucky

Postby SaintsOfTheDiamond » Tue May 08, 2007 2:47 pm

Is there any sort of regulation on what can proceed the CARDID portion? Instead of .* use \w* or build up a set yourself with [a-zA-Z0-9] etc. I'm pretty sure \b isn't what you want though because that would mean only strings beginning with CARDID and having the appropriate number would be matched.
Image
Member #4 of the Inaugural Yadier Molina Fan Club!!!
SaintsOfTheDiamond
Hall of Fame Hero
Hall of Fame Hero

Fantasy ExpertCafe WriterCafe Ranker
Posts: 6480
Joined: 6 May 2004
Home Cafe: Baseball
Location: Swiping second

Postby StlSluggers » Tue May 08, 2007 2:49 pm

SaintsOfTheDiamond wrote:Is there any sort of regulation on what can proceed the CARDID portion? Instead of .* use \w* or build up a set yourself with [a-zA-Z0-9] etc. I'm pretty sure \b isn't what you want though because that would mean only strings beginning with CARDID and having the appropriate number would be matched.

The preceeding stuff is based on questionnaire answers, so it's quite varied.

I did run it with /b at the beginning, and it did not pull any matches.
StlSluggers
Hall of Fame Hero
Hall of Fame Hero

User avatar
CafeholicCafe WriterMock(ing) DrafterWeb Supporter
Posts: 14716
Joined: 24 May 2004
Home Cafe: Baseball
Location: Parking in the gov't bldg @ 7th and Pine. It's only $3.00 on game day!

Postby SaintsOfTheDiamond » Tue May 08, 2007 2:56 pm

StlSluggers wrote:
SaintsOfTheDiamond wrote:Is there any sort of regulation on what can proceed the CARDID portion? Instead of .* use \w* or build up a set yourself with [a-zA-Z0-9] etc. I'm pretty sure \b isn't what you want though because that would mean only strings beginning with CARDID and having the appropriate number would be matched.

The preceeding stuff is based on questionnaire answers, so it's quite varied.

That's what I figured. You could still narrow it down to alphanumeric, digits and a handful of special characters (properly escaped of course) couldn't you? Maybe not. :-?

EDIT: That is, of course, if you think .* is causing the problems.

StlSluggers wrote:I did run it with /b at the beginning, and it did not pull any matches.

That's because it's \. ;-) :-b
Last edited by SaintsOfTheDiamond on Tue May 08, 2007 2:57 pm, edited 1 time in total.
Image
Member #4 of the Inaugural Yadier Molina Fan Club!!!
SaintsOfTheDiamond
Hall of Fame Hero
Hall of Fame Hero

Fantasy ExpertCafe WriterCafe Ranker
Posts: 6480
Joined: 6 May 2004
Home Cafe: Baseball
Location: Swiping second

Postby Amazinz » Tue May 08, 2007 2:56 pm

How is the data you are parsing formatted? For instance, if there are line breaks in the string .* won't match correctly depending on the regex implementation. Could it be something like that?
Image
Maine has a good swing for a pitcher but on anything that moves, he has no chance. And if it's a fastball, it has to be up in the zone. Basically, the pitcher has to hit his bat. - Mike Pelfrey
Amazinz
Mod in Retirement
Mod in Retirement

User avatar
CafeholicFantasy ExpertCafe WriterCafe RankerMock(ing) DrafterEagle EyeWeb SupporterPick 3 Weekly WinnerSweet 16 SurvivorLucky Ladders Weekly Winner
Posts: 18800
Joined: 16 Mar 2004
Home Cafe: Baseball
Location: in Canada, toughening up figure skaters

Postby StlSluggers » Tue May 08, 2007 3:03 pm

SaintsOfTheDiamond wrote:
StlSluggers wrote:I did run it with /b at the beginning, and it did not pull any matches.

That's because it's \. ;-) :-b

Yeah, yeah... I need to stop thinking of BBCode when I type here. :*)

Amazinz wrote:How is the data you are parsing formatted? For instance, if there are line breaks in the string .* won't match correctly depending on the regex implementation. Could it be something like that?


Here are quite a few examples:

CitiBusiness PremierPassSM Card,BANK--Citibank__CARDID--4
QuickBooks Platinum Plus for Business MasterCard,BANK--MBNA America Bank__CARDID--7
Advanta Platinum BusinessCard,BANK--Advanta__CARDID--14
Harris MasterCard®* BusinessCard®*,BANK--Harris Trust and Savings Bank__CARDID--1
Advanta Platinum BusinessCard,BANK--Advanta__CARDID--9
*CitiBusiness® Card with ThankYouSM Network,BANK--Citibank__CARDID--6
CitiBusiness® Card,BANK--Citibank__CARDID--18
Chase Business Rebate Card,BANK--JP Morgan Chase and Co.__CARDID--11
Standard Federal MasterCard BusinessCard Card,BANK--Standard Federal Bank__CARDID--26
GM,BANK--JP Morgan Chase and Co.__CARDID--15
LaSalle MasterCard BusinessCard Card,BANK--LaSalle Bank__CARDID--25
Continental Business MasterCard from Chase,BANK--JP Morgan Chase and Co.__CARDID--8
Platinum Plus<sup>sm</sup> Business Rewards MasterCard,BANK--MBNA America Bank__CARDID--10
<i>Platinum Plus</i>®<i>for Business</i> MasterCard,BANK--MBNA America Bank__CARDID--16
QuickBooks Platinum Plus for Business MasterCard,BANK--MBNA America Bank__CARDID--13
*Citi Professional(SM) Cash Card,BANK--Citibank__CARDID--24

What's giving me fits is that the manual sum of the data is falling short of the sum given by the regex query. I'm much more confident in the manual tally because I can pull the whole string and then parse it myself. Of course, the data stream seems to be corrupted today, so it's not like I'm going to make much progress in the verification realm today.

:~(
StlSluggers
Hall of Fame Hero
Hall of Fame Hero

User avatar
CafeholicCafe WriterMock(ing) DrafterWeb Supporter
Posts: 14716
Joined: 24 May 2004
Home Cafe: Baseball
Location: Parking in the gov't bldg @ 7th and Pine. It's only $3.00 on game day!

PreviousNext

Return to General Talk

Who is online

Users browsing this forum: unioreimi and 7 guests

Forums Articles & Tips Sleepers Rankings Leagues


Today's Games
Monday, Sep. 1
(All times are EST, weather icons show forecast for game time)

Philadelphia at Atlanta
(1:10 pm)
NY Mets at Miami
(1:10 pm)
indoors
Boston at Tampa Bay
(1:10 pm)
indoors
Minnesota at Baltimore
(1:35 pm)
Pittsburgh at St. Louis
(2:15 pm)
Milwaukee at Chi Cubs
(2:20 pm)
Seattle at Oakland
(4:05 pm)
Detroit at Cleveland
(4:05 pm)
San Francisco at Colorado
(4:10 pm)
Arizona at San Diego
(4:10 pm)
Texas at Kansas City
(8:10 pm)
Washington at LA Dodgers
(8:10 pm)

  • Fantasy Baseball
  • Article Submissions
  • Privacy Statement
  • Site Survey 
  • Contact