Jump to content

rednebmas

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

rednebmas's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Sorry I didn't make this clear before. The division sign will not always be the only division sign. There could be multiple signs and you don't always want to put it into frac{}{}. For example ((n+11)!/(n-k)^(-1))+(11)/(2) your code would output: frac{(n+11)!}{(n-k)^(-1))+(11)}{(2} what I would like: frac{(n+11)!}{(n-k)^(-1)}+(11)/(2)
  2. Examples: input: (n!/(1+n)) output: frac{n!}{1+n} input: ((n+11)!/(n-k)^(-1)) output: frac{(n+11)!}{(n-k)^(-1)} input: (9/10) output: frac{9}{10} The following regex works if there are no sub parentheses. \(([^\/\)]*)\/([^\)]*)\) The following does matching parentheses @\((([^()]++|\((?:[^()]++|(?R))+\))+)\)@ I just can not figure out how to "combine them". If you would more examples let me know.
  3. Sorry, I can't figure out how to edit apost... This: "sqrt(\((?:[^()]++|(?1))+\))" matches "(5^(x+3)-7)" but I need it to match "5^(x+3)-7". How can I remove the outside parentheses?
  4. sqrt(\((?:[^()]++|(?1))+\))
  5. Hey guys, I am trying to capture stuff inside the parentheses. The problem is that it is possible for parentheses to be inside the sqrt. example string: "sqrt(5^(x+3)-7)" desired output capture: 5^(x+3)-7 desired output: sqrt{5^(x+3)-7} The following captures the correct part but it doesn't work if you put sqrt before it. /\((?:[^()]+|(?R))*\)/ For reference: http://php.net/manual/en/regexp.reference.recursive.php
  6. Yep. Entire php section <?php $subject = $_GET['subject']; $userID = $_COOKIE['userID']; include("database.php"); $today = dateAdd("now","+0 days"); $correctRow = selectrow("SELECT * FROM correct WHERE nextTimeToAnswer <= '$today' and subject = '$subject' and userid = $userID"); $problemid = $correctRow['problemid']; $correctid = $correctRow['id']; $problemRow = selectrow("SELECT * FROM problems WHERE id = $problemid"); $question = $problemRow['question']; $answer = $problemRow['answer']; echo "<table border='0'><tr><td><div id='question'><b>Question:</b><br/>$question</div></td></tr>"; echo "<tr><td><div id='answer' style='display:none;'><b>Answer:</b><br/>$answer</div>"; echo "<a href=\"javascript:showdiv('answer')\">Show Answer</a></td></tr>"; echo "<td><tr><a href='submitanswer.php?correct?=yes&correctid=$correctid>I got this correct!</a></tr></td></table>"; ?> Forgot to close the href with '
  7. It is not outputting anything after the third echo. This is where it is http://sambender.com/brandon/review.php?subject=Math%20Problems echo "<table border='0'><tr><td><div id='question'><b>Question:</b><br/>$question</div></td></tr>"; echo "<tr><td><div id='answer' style='display:none;'><b>Answer:</b><br/>$answer</div>"; echo "<a href=\"javascript:showdiv('answer')\">Show Answer</a></td></tr>"; echo "<td><tr><a href='submitanswer.php?correct?=yes&correctid=$correctid>I got this correct!</a></tr></td></table>"; It just outputs <table border='0'><tr><td><div id='question'><b>Question:</b><br/>What is your name?</div></td></tr><tr><td><div id='answer' style='display:none;'><b>Answer:</b><br/>Rooba holabint</div><a href="javascript:showdiv('answer')">Show Answer</a></td></tr><td><tr>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.