
blackeagle225
Novice
Jul 27, 2011, 10:12 AM
Post #1 of 5
(2034 views)
|
|
Precompiled Regex
|
Can't Post
|
|
Hello, I have a program that uses two regex expressions. The two expressions are the same (I'm using them to extract the values from two of the columns). I have tried to precompile the regex to run faster with qr, but either I'm doing it wrong, or it's not actually running faster. I would like to speed up this program and would love any help. Thanks in advance.
$RegexString = qr/\w+\t(\d+)\t(\d+)\t\w+/; ... if ($LineSox =~ $RegexString) { #search for pattern and set the results as the indicated variable. $ChrStartSox = $1; $ChrEndSox = $2; ... if ($Exact =~ $RegexString) { #Search for the pattern, and put them in variables. $ChrStartExact = $1; $ChrEndExact = $2; ...
|