Hello @banksider,
@banksider wrote:
(...) x1 = "123-". If I use prxparse("/\ddd-/") and prxmatch I can return position 1 for this value.
You mean "/\d\d\d-/", right?
Now, if I didn't know ("/\ddd-/"), would there be a way for me to obtain ("/\ddd-/") from "123-"?
The first thing I virtually always do to obtain a regular expression is to open the Tables of Perl Regular Expression (PRX) Metacharacters.
That's, is there a way to obtain the perl regular expressions for any entry?
I don't think there's an automated way to obtain "the" regex for any entry, simply because it is not unique: In your example there is a variety of matching regular expressions (depending on the purpose) ranging from very specific expressions such as "/123-/" to very general expressions like "/.*/". You may want to choose "/\d\d\d-/" for your purposes, but others would prefer, e.g., "/\w{3}?-/" for their purposes.
... View more