(a) select the 6 digits number from the beginning or 9 digits. Examples
"123456789" -> "123456789"
"1234567895" -> "123456789"
"12345678" -> nil
"12345" -> nil
(b) select the first 6 or 9 characters. Examples
(a) select the 6 digits number from the beginning or 9 digits. Examples
"123456789" -> "123456789"
"1234567895" -> "123456789"
"12345678" -> nil
"12345" -> nil
(b) select the first 6 or 9 characters. Examples
I wouldn't use a single regex to solve this - I'd use multiple checks
and if statements. I'd try to give you an example if I could understand
your rules, you're not clear about when to follow which rules.
I wouldn't use a single regex to solve this - I'd use multiple checks
and if statements. I'd try to give you an example if I could understand
your rules, you're not clear about when to follow which rules.
I haven't heard of RegExr before -- it is interesting, but I haven't
played much with it yet.
If you're curious, check out my own project:
Cheers,
Hal
···
On Tue, Sep 17, 2013 at 12:58 AM, Robert Klemme <shortcutter@googlemail.com>wrote:
On Tue, Sep 17, 2013 at 2:09 AM, Leslie Viljoen <lists@ruby-forum.com> > wrote:
> You can also try: http://rubular.com
>
> I wouldn't use a single regex to solve this - I'd use multiple checks
> and if statements. I'd try to give you an example if I could understand
> your rules, you're not clear about when to follow which rules.