What is Expressions: Definition and 331 Discussions

A regular expression (shortened as regex or regexp; also referred to as rational expression) is a sequence of characters that specifies a search pattern. Usually such patterns are used by string-searching algorithms for "find" or "find and replace" operations on strings, or for input validation. It is a technique developed in theoretical computer science and formal language theory.
The concept arose in the 1950s when the American mathematician Stephen Cole Kleene formalized the description of a regular language. The concept came into common use with Unix text-processing utilities. Different syntaxes for writing regular expressions have existed since the 1980s, one being the POSIX standard and another, widely used, being the Perl syntax.
Regular expressions are used in search engines, search and replace dialogs of word processors and text editors, in text processing utilities such as sed and AWK and in lexical analysis. Many programming languages provide regex capabilities either built-in or via libraries, as it has uses in many situations.

View More On Wikipedia.org
  1. brainpushups

    Showing that the Ratio of Two Expressions is Always Greater Than 1

    I was trying to follow a proof that Huygens wrote about collisions and was having a hard time deciphering his rather lengthy geometric presentation. Essentially I want to compare two expressions $$\frac{2x}{x+z}$$ and $$\frac{4xy}{(x+y)+(y+z)}$$ Where, for the sake of this thread let's say...
  2. Hepth

    Mathematica [Mathematica] : Method to import C-Code to Expressions

    I have some ugly c-code that was generated from Mathematica in years past with CForm, and looks like : (PolyLog (2,(-1 + t)*pow (-1 + q2h,-1))*pow (q2h - t,-1)*pow (-1 + \ t,-1)* (-8*pow (q2h,3)*pow (t,2) + pow (q2h,4)*(1 + pow (t,2)) - 8*q2h*pow (t,3)*(-3 + 8*t - 5*pow (t,2) +...
  3. cryora

    Any tips on how to work with complicated expressions?

    Homework Statement I'm not exactly where a question like this would belong, so I am going to try here. It feels like as we go higher in our courses, we're expected to be able to work with more complicated equations. One example would be a problem involving transmission reflection ratios for...
  4. J

    MHB Grammars and regular expressions.

    Hi, I'm struggling with a question about a grammar, since I haven't done them for a few months and have forgotten how they work. a.) Let L be the language generated by G. Find a sentence a of L which is composed of three terminal symbols and that shows that G is ambiguous. Show two different...
  5. G

    Show the equality of two expressions

    Homework Statement Show that \sum_{k=0}^{N-1}e^{\gamma \tau k}\int_{0}^{\tau}F'(k\tau+s)ds can be written as \int_{0}^{t}e^{\gamma t'}F'(t')dt' Homework Equations 1. t=N\tau 2. \int_{0}^{\tau}F'(k\tau+s)ds has the same statistical properties for each interval of length \tau, and is...
  6. L

    Fortran Using Integer Expressions in an If Statement: Help Needed!

    Hi, so I'm trying to use the following if statement: if (sum(i,j) <=1.0 ) then sidash=(si)*(Death) else if (1 <= sum(i,j) <= 2) then sidash=(si)*((sqrt(2.0)+1.0)*(2.0-sum(i,j))*(Death)+(sum(i,j)-1.0)*(Survive)) else if (sum(i,j)<=3 .and. sum(i,j)=>2) then...
  7. K

    MHB Derivatives of symmetric expressions

    So I was bored in math class and came up with this series of related questions, that I cannot answer: Is there a clean expression for $f'(x),$ where $$f(x)=\prod_{i=1}^{n}\dfrac{(x-i)}{(x+i)}?$$ What about for $f''(x)?$ Or for $$f(x)=\prod_{i=1}^{n}\dfrac{(x^2-i)}{(x^2+i)}?$$
  8. B

    Equilibrium expressions and partial pressures

    Homework Statement In considering the reaction: 3NO (g) + H2O (l) → 2HNO3 (aq) + NO (g) student A writes the equilibrium expression as: K=[NO][HNO3]2/[NO2]3 while student B writes: K=PNO [HNO3]2/[NO2]3 Whose equation is correct? Homework Equations NA The Attempt at a Solution This is a...
  9. M

    MHB Exploring the Complexity of Satisfiable Boolean Expressions

    Hey! :o The Boolean expression $(p_1+p_2)*p_3$ can be represented by the string $(1+2)3$, where integer $i$ represents variable $p_i$. Consider the language $L$ consisting of all strings representing satisiable Boolean expressions (those for which some assignment of $0$'s and $1$;1 to the...
  10. S

    MHB Absolute Value with two expressions.

    How do I do this? I have tried a few methods and end up getting x values that don't work when placed back into the equation.
  11. B

    Using FOIL with "Longer" Expressions - HELP

    Homework Statement Multiply Out: (x^2 + 3x - 5)(x - 2) Homework EquationsThe Attempt at a Solution I've only seen the FOIL method of multiplying factors where inside the parenthesis of each factor are two terms. So, I know if you have (x - 3)(x + 5), then you get: x^2 -3x +5x -15, which...
  12. Z

    MHB Finding the LCM of two expressions

    Find the least common denominator of 3(2x-2) and x(5x-)5 I wanted to double check this, I got 10 as an answer? If not how would you get the LCD? .
  13. Z

    MHB Finding the LCD of two expressions

    Another question for you? Find the least common denominator of 3/(2x-2) and x/(5x-5) I came up with 10?
  14. S

    Why do you integrate expressions for work + (hw problems)?

    Question: A single conservative force acts on a 5.00-kg particle. The equation Fx = (2x + 4) N, where x is in meters, describes this force. As the particle moves along the x-axis from x = 1.00 m to x = 5.00 m, calculate (a) the work done by this force. Work = Force * Distance. (2*(5-1) +4) =...
  15. T

    MHB Finding expressions for the five other trigonometric functions....

    So here's the question: Suppose cos(θ) =x/4. Find expressions for the other five trigonometric functions in terms of x. In our practice problems we never had a variable x used and we were able to use the pythagorean theorem to determine the final side of the triangle and simply figure out the...
  16. A

    MHB Double check my expressions a+b squareroot c

    Can anyone double check my answers? I have to put the answer in this format a+b\sqrt{c} a)(3-\sqrt{18})^{2} Answer (3-\sqrt{18}) \quad(3-\sqrt{18}) 9-3\sqrt{18}-3\sqrt{18}+18 9-6\sqrt{18}+18 27(-6)\quad(3\sqrt{2)} =27-18\sqrt{2} \therefore a = 27 b = -18 c = \sqrt{2} Wouldn't I have to put it in...
  17. G

    Why are these 2 expressions equal?

    Why is this true (at least, according to my calculator)? Is there something obvious that I've missed? \int_{0}^{1}\frac{1}{x^x}dx=\sum_{x=1}^{\infty }\frac{1}{x^x}
  18. R

    Writing down expressions for traveling waves

    Homework Statement There is no specific problem - this is more of a broad question...given a wave equation and asked to write down/guess an expression/general solution for a traveling wave, it is sufficient to say the following: 1) For \frac{\partial^2 E}{\partial z^2} -...
  19. A

    MHB Simplifying rational expressions

    If its not problem for you to check these last two. I got no more of these. If you have some kind a book with tasks like this on internet I would love to print it out so I can have some fun. 1ST answer 20/3 2ND answer -20/3
  20. Dethrone

    MHB Limits of Complex Expressions: Infinity or 0?

    1. =\lim_{{x}\to{\infty}} (x^3+\sqrt{x^6+x^3+1} Multiplying top and bottom by x^3-\sqrt{x^6+x^3+1}, we get: =\lim_{{x}\to{\infty}} \frac{x^3+1}{x^3-\sqrt{x^6+x^3+1}} Dividing by the highest power: =\lim_{{x}\to{\infty}} \frac{1+\frac{1}{x^3}}{1-\sqrt{1+\frac{1}{x^3}}} =\lim_{{x}\to{\infty}}...
  21. M

    Need free program to plot expressions in polar coordinates

    Homework Statement Need a free program to plot expressions in polar coordinates. For example, I want to plot the equipotentials for an expression in polar coordinates of the potential for a dipole charge, 4q and -q separated by a distance L. Homework Equations V=kq(4/r1 - 1/r), where r12...
  22. D

    Inequalities of rational expressions

    referring to the photo attached, can anyone expalin and give suitable numerical example please? i couldn't understand the notes.
  23. D

    MHB Recursive sequences and finding their expressions

    Hi all, I don't understand what is being asked by this question? If anyone knows could they please describe the process, that would be greatly appreciated.
  24. E

    MHB Solving Equivalent Expressions Using Subtraction Method

    How do you determine if the two expressions are equivalent using the subtraction method?\frac{2x^3+7x^2-5x-6}{x+1} - [(2x^2+5x-10) + \frac{4}{x+1}] The textbook says that they're equivalent. I know that, using the subtraction method, they have to equal 0 in order to be equivalent. But, I'm not...
  25. E

    MHB What am I doing wrong? (Simplifying Rational Expressions)

    7a) Simplify and state any restrictions on the variables: \frac{x^2-5xy+4y^2}{x^2+3xy-28y^2} ⋅ \frac{x^2+2xy+y^2}{x^2-y^2} I'm not really sure what a good process would be to simplify this. This is what I tried to do, (below) which is wrong. Could anyone point out what I did wrong and what a...
  26. N

    Deriving expressions for Fourier Transforms of Partial Derivatives

    Homework Statement Using the formal limit definition of the derivative, derive expressions for the Fourier Transforms with respect to x of the partial derivatives \frac{\partial u}{\partial t} and \frac {\partial u}{\partial x} . Homework Equations The Fourier Transform of a function...
  27. M

    Equivalent expressions for infinite series

    Question: I was just wondering if there was any error in what I've done in the following steps to find the series representation of ##lnx##. I know ## \frac {1}{x}## is given in the following link by doing having the a function centred at 0, you can let ##f(x) = ∑^∞_{n=0} \frac...
  28. B

    Deriving expressions for total capacitance

    Hello, my timetabled experiments for lab work are a week or two ahead of my E&M course which means I'm doing the experiments before being introduced to the theory. As part of my prep work I need to come up with an expression for the total capacitance of a number of different circuits involving...
  29. Grog85

    Letters in expressions and formulas

    Hello, first post for me so I am sorry if this is in the wrong topic. I'm am from the UK studying A-Level Physics. I understand some formulas but this is testing me. Before I message my tutor I thought I would try here. Looks like a very useful website. Letters in expressions and...
  30. A

    Maximum size of a set containing logical expressions

    Hi Can you please help me with this problem? "What is the maximum size of a set A of logical expressions that only use →, p, q : each pair of elements of A are not equivalent?" I've found 6 different possible truth values. Is this the maximum size? If yes, how do I prove it? Thanks!
  31. evinda

    MHB Are the regular expressions the same?

    Hi!I have also an other question. Is the regular expression $\{\{a,b,c\}^{*} \cdot aba \cdot \{a,b,c\}^{*}\}\cap\{\{a,b,c\}^{*} \cdot cbc \cdot \{a,b,c\}^{*}\}$ equal to this one: $\{\{a,b,c\}^{*} \cdot aba \cdot \{a,b,c\}^{*} \cdot cbc \cdot \{a,b,c\}^{*}$ or is there a difference?
  32. evinda

    MHB Regular Expressions Help: Find Language for DFA Drawing

    Hello! I have to draw the DFA of the language of the following expressions: a){1^*\{00,010,\varnothing\}(01)^{*}} b)(\{\{1,0\}^{*},(\varnothing,2)^*\})^{*} Could you help me to find the languages that are meant,so I can draw the DFAs?
  33. L

    MHB Algebraic Expressions Simplified

    How does 3x or (x-5) equal 0 in the statement 3x(x-5)=0? I don't understand the logic behind it. Thank you!
  34. H

    Compound/complex fractional expressions. Algebra 1.

    Homework Statement x/y - y/x ---------- 1/x^2 - 1/y^2 Simplify the compound fractional exponent. Homework Equations The process that you are supposed to use are 1. finding the LCD and combining the expressions in the numerator and then the denominator, making it just a regular...
  35. E

    Solving Complex Expressions: 1/z^2 & 1/z^3

    Hello I'm studying complex numbers for class and the question is stated as: Let z=1+2i Find: a) 1/z^2 b) 1/z^3 I was thinking just to multiply by the conjugate (1-2i)^2 for (a) and similarly for (b). Would that be correct in solving it?
  36. P

    Using suffix notation to find alternative expressions

    Homework Statement use the relationship ε_{ijk} ε_{klm}=δ_{il}δ_{jm}-δ_{im}δ_{jl} to find an alternative expression for ε_{ijk}ε_{ilm}. Hence simplify ε_{ijk}ε_{ijm} 2. Homework Equations I know that the kronecker delta is 1 for i=j and 0 for i not equal to j. and that the alternating...
  37. M

    Linearity of boolean expressions

    given an sop form of a multi variable boolean expression, how to judge if it is linear or not? is (x or y) linear? more generally, can a function be linear with an and in sop form?
  38. U

    Writing expressions, Markov Models

    Homework Statement Through donations the food bank tries to feed as many people as possible. Assume there are no backorders - any unsatisfied demand is lost. The food bank also has limited facilities to store donations, 200,000lbs maximum can be held in storage. Assume donations are processed...
  39. V

    Solving inequalities with rational expressions.

    Homework Statement Identify the solution set of the inequality. Homework Equations 5x + 1 / x- 1 ≥ 7 The Attempt at a Solution I multiplied both sides by x - 1 which gave me 5x+1 ≥ 7x - 7 Then I combined like terms together which gave me 8 ≥ 2x I divided both sides by 2 which gave...
  40. DrClaude

    Why do we often misunderstand expressions?

    Read a post today where someone was asking for an explanation in "Lehman's terms." Oh brother! (pun intended) Anyone have any funny misunderstood expressions to share?
  41. polygamma

    MHB Using expressions like "easy to see" or "it is obvious"

    Why are such expressions used so incredibly frequently by mathematicians and aspiring mathematicians? I think sometimes they are used to discourage questions, while other times it might just be an ego-boosting thing. Any thoughts?
  42. E

    Geometric expressions for a quarter circle cut at an arbitrary point

    Homework Statement I am after finding general geometric expressions for a quarter-circle that is split into two segments along either its domain or range (they are equal). I.e. Taking the circle shown in Figure 1 and concentrating on the upper right quadrant, I am after expressions for the...
  43. F

    Simplification of Boolean Expressions

    Hi guys - I am really new here and am taking a very very elementary course in Logic circuits/Boolean algebra. We have been given a couple of simplification questions and I was convinced I had used all the theorems correctly but two of us got two different answers and we can't find who has gone...
  44. H

    Simplifying many body operator expressions

    Hello all, Is there any really good software, package or otherwise, that is helpful for simplifying long operator expressions, particularly with (anti-commuting) electron operators? For example, I'd like to be able to transform Hamiltonians, project onto subspaces with specific occupation...
  45. L

    Question about rational expressions and their domains

    Hi there. I am currently taking "College Math 1" at the local CC and I have encountered something that confuses me regarding rational expressions and their domains. The definition given by the textbook for rational expressions is: "the set of real numbers for which an algebraic expression is...
  46. O

    Analytically Solving Complex Expressions with Wolfram Alpha

    I'm noticing wolfram alpha has the amazing ability to analytically solve \sum_{n=1}^{\infty} \frac{1}{n^2 + a^2} Anyone know how to do this, and if it's also possible to deal with higher order guys (like it also can do 1/(n4+a2), but it's a way more complicated expression to the point...
  47. D

    Gravitation equations and expressions - gravitational field strength

    Homework Statement i have 2 questions on my holiday homework that I am not 100% sure on they are: Homework Equations 1) write down an algebraic expression for g at a distance r from the centre of the planet. The planet can be treated as a point mass of magnitude M as its centre AND 2) write...
  48. S

    Is Log n Equal to Any of These Expressions for All Instances of n?

    Homework Statement The Attempt at a Solution I believe log n does not equal any of these for all instances of n, but may for one specific instance...not entirely positive but I want to see what you guys think.
  49. N

    Problem with evaluation expressions with exponents

    The way i am evaluating post fix expressions is not working with exponents Example InfixII 3*(4^2-2/3)+4 To post fix 342^*23/-4+ =16*3-2/3)+4 Am i evaluating the parenthesis the wrong way
  50. A

    Difficult rational expressions thinking question

    Homework Statement Find the Values of B and C given this: \frac{(3x-18)}{(2x+1)(7x-3)}= \frac{B}{2x+1} + \frac{C}{7x-3} Homework Equations The equation given: \frac{(3x-18)}{(2x+1)(7x-3)}= \frac{B}{2x+1} + \frac{C}{7x-3} The Attempt at a Solution My attempt: \frac{(3x-18)}{(2x+1)(7x-3)}=...
Back
Top