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 ?
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.
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.
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?
{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.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With