Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are regular expressions the same in every programming language?

I am a python user looking to learn regular expressions and I have just a good good course on Udemy that seems to be OK. However it is neither a python course nor a python regular expression course.

Are regular expressions the same on any programming language ?

I mean would they be the same and use the exact same syntax I would be using with the re package in python ?

like image 302
Herc01 Avatar asked Nov 04 '17 13:11

Herc01


People also ask

What are regular expressions?

Regular Expressions are a particular kind of formal grammar used to parse strings and other textual information that are known as "Regular Languages" in formal language theory. They are not a programming language as such.

What is the difference between a programming language and a regex?

They are more of a shorthand for coding that would otherwise be extremely tedious to implement and even more confusing than the sometimes arcane looking Regex. Programming Languages are typically defined as languages that are Turing Complete.

How do you know if two regular expressions are equivalent?

Note : Two regular expressions are equivalent if languages generated by them are same. For example, (a+b*)* and (a+b)* generate same language. Every string which is generated by (a+b*)* is also generated by (a+b)* and vice versa. How to solve problems on regular expression and regular languages?

What is the difference between regular language and grammar?

{a, ab, abb, abbb, abbbb,….} Regular Grammar : A grammar is regular if it has rules of form A -> a or A -> aB or A -> ɛ where ɛ is a special symbol called NULL. Regular Languages : A language is regular if it can be expressed in terms of regular expression.


1 Answers

there are variations on them...

this site will give you a way to test your expression for some common languages (including python)...

https://regex101.com/

like image 50
me_ Avatar answered Oct 29 '22 20:10

me_