Jump to content

[SOLVED] simple regex


marcus

Recommended Posts

since the php regex forum doesn't seem to be ever-so popular i'd figure i would post here

 

personally i suck when it comes to regular expressions, so if anybody could lead me to a path where i can help understand them it would be great...

 

anyone, my problem is: i'm trying to convert such variables like x^y so that ^y would turn into <sup>y</sup>

 

So if the user inputted x^2 + 5x - 4 the output in HTML would read x<sup>2</sup> + 5x - 4, and along with more exponents like: x^3 + 3x^2 + 4x - 2 would be x<sup>3</sup> + 3x<sup>2</sup> + 4x - 2

Link to comment
https://forums.phpfreaks.com/topic/143068-solved-simple-regex/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.