What is [50-99] in regular expression?

  • Thread starter Thread starter shivajikobardan
  • Start date Start date
  • Tags Tags
    Expression Regular
AI Thread Summary
The discussion centers around the interpretation of the regular expression character set notation [50-99]. It clarifies that this notation does not represent the numeric range from 50 to 99 but rather matches individual characters between '5' and '9', which includes characters like '5', '6', '7', '8', and '9'. The confusion arises from treating the numbers as a range rather than as character representations. Participants recommend resources for learning regular expressions, highlighting regexone.com for its structured learning approach and regexpal for testing expressions. The learning process involves understanding character ranges and practicing with examples to grasp the nuances of regex syntax.
shivajikobardan
Messages
637
Reaction score
54
TL;DR Summary
regular expression character set meaning for [50-99]?
As the slide says, it's not 50-99 characters so what it is?

PDxPmiqvcz9UjWNJKyeZR2DyyMOULpLAZS0IaLfjCjF0kCR-sA.png

Source: https://www3.cs.stonybrook.edu/~pfodor/courses/CSE307/L02_Programming_RE.pdf

Also, please tell me how to learn regular expressions? Recommend some university/any courses to take for learning regular expression for backend development. (Not the one we learnt in theory of automata and computation).

There are lots of resources to learn it like regexpal for testing regular expressions, regexone.com for learning it. But how'd you learn it? Like what process do you follow to learn it?
 
Technology news on Phys.org
shivajikobardan said:
TL;DR Summary: regular expression character set meaning for [50-99]?

As the slide says, it's not 50-99 characters so what it is?
The answer is in the slide: [50-99] is the same as [0-9]. Why do you think this is?
[5] matches a 5, [9] matches a 9, [59] matches a 5 or a 9, [0-9] matches any character 0-9
shivajikobardan said:
regexone.com for learning it. But how'd you learn it? Like what process do you follow to learn it?
I had not seen https://regexone.com/ before: it looks really good so learn from that.
 
A key idea on the page about character ranges is this:
represent all characters between two characters
So 50 and 99 are not treated as numbers, but rather as a pair of characters each,
 
but I tried in regexpal, [50-99] matches number between 50-99 as well? @pbuk

edit: I'm wrong it also matches 98888
 
I got it. it's [5,0-9,9] that's why.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top