Mapped attribute and regex not returning expected result
Tom Scavo
trscavo at gmail.com
Mon Apr 30 19:07:08 EDT 2018
On Mon, Apr 30, 2018 at 6:52 PM, Lipscomb, Gary <glipscomb at csu.edu.au> wrote:
>
> If the employeeNumber is
> 12345678 it returns 12345678 as expected
> 12345678A it returns 12345678 as expected
> 1234A it returns 1234 as expected
>
> 1234A5678 it returns nothing but I expected 1234. The attribute is not populated
Not all regex processors are equivalent but these shell commands (on
Mac OS) should give you some idea:
$ foo="12345678
12345678A
1234A
1234A5678"
$ echo "$foo" | sed -E 's/^([0-9]*).*$/\1/'
12345678
12345678
1234
1234
Hope this helps,
Tom
More information about the users
mailing list