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.
So I just completed a simple exercise that converts all letters of a string to upper case letters. The program works but it comes with the warning: comparison between signed and unsigned integer expressions [Wsign-compare].
What does this mean? While whatever is causing the warning does not seem...
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...
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) +...
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...
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...
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...
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...
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)}?$$
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...
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...
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...
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) =...
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...
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...
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}
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} -...
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
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}}...
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...
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.
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...
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...
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...
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...
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...
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...
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!
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?
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?
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...
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?
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...
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?
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...
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...
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?
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?
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...
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...
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...
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...
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...
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...
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.