Is there a way to simplify an expression such as this
([0-9]||[A-Z])([0-9]||[A-Z])([0-9]||[A-Z])([0-9]||[A-Z])([0-9]||[A-Z])([0-9]||[A-Z])
to something like {([0-9]||[A-Z]) = B } BBBBBB Where B represents a duplication of a sub expression.
I'm coding in labVIEW but I'm interested in a solution that is language independent.
Sure, you can just:
([0-9]||[A-Z]){6}
The 6 refers to the number of items you'll accept. You can also:
([0-9]||[A-Z]){3,6}
Which would mean accept between 3 and 6 of these...
Try this: ([0-9]||[A-Z]){6}
You can use {x} to designate the number of times you want it to show up. {6} means the pattern 6 times. You can use {1,6} to mean 1, 2, 3, 4, 5, 6 times.
One thing I like to have printed up next to my desk if I'm using Regular Expressions is this:
Regular Expression Cheat Sheet
It has saved me a number of times on syntax and such.
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