[tpm] Regex assistance

Rob Janes janes.rob at gmail.com
Thu Aug 11 08:29:51 PDT 2016


^,* in front then |(\d\d\.\d\d\d),*$ after?

Ok replace bar with ,.*,
On Aug 11, 2016 10:38 AM, "Chris Jones" <cj at enersave.ca> wrote:

>
> Hello Perl Mongers,
>
> I am looking for assistance with a regex. I have a bunch of strings in for
> form:
>
> "01.03.16,,Studio one, Space 22,1         500,500,01.051,,"
> or
> ",01.03.16,,Studio one, Space 22,1         500,500,01.051,"
> or
> ",01.03.16,,Studio one, Space 22,1         500,500,01.051,,"
> or
> ",01.03.16,,Studio one, Space 22, ,01.051,,"
>
> So the middle section can be one or more comma separated strings.
>
> I am trying to match and return the first non-blank pattern and the last
> non-blank pattern
> 01.03.16 and 01.051 – these numbering formats are always the same:
> xx.xx.xx and yy.yyy
>
> So far I have a regex that matches the first pattern:
>
> "([0-9]{2})([\.])([0-9]{2})([\.])([0-9]{2})"
>
> In any of those above example.
>
> I am stuck after that.
> Any insights appreciated!
>
>
>
> --
>
> Chris Jones
> 14 Oneida Avenue
> Toronto, ON M5J 2E3
> 416-697-0056
>
> _______________________________________________
> toronto-pm mailing list
> toronto-pm at pm.org
> http://mail.pm.org/mailman/listinfo/toronto-pm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20160811/9ce3208a/attachment.html>


More information about the toronto-pm mailing list