in reply to Pattern Matching Issues
Maybe you just need to put a backslash in front of the question mark in that regex: /\.cfm\?member=(.*)\" class=/g because the question mark is really a regex operator, meaning "0 or 1 occurrences of the preceding character or group".
By the way, assuming that you are not setting "$/" to some special (non-default) value, the chomp is really a no-op, because your regex will never return a string that ends in a linefeed.
Update: I have to throw in a couple extra nit-picks: Since you are not changing the name of the output file inside the foreach loop, your process will work better if you open the output file only once, before the loop, and close it only once, after the loop. This won't make a big difference for small jobs, but an open/close on every iteration of a loop like that "does not scale well" when you get into large numbers of rapid iterations. Also, consistent indentation of source code is worthwhile.
|
|---|