Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
matthudson Absent Member.
Absent Member.
129 views

Using regular expression to check text import field size


Hi,

I'm trying to place size restrictions on a delimited text driver import
like this:

> if operation attribute 'Description' not-match "{1,10}"


and it's failing miserably.

Ideally I want to stop entries bigger than the schema restrictions and
generate and veto and a log entry.

Any ideas?

Thanks,
Matt


--
matthudson
------------------------------------------------------------------------
matthudson's Profile: http://forums.novell.com/member.php?userid=18744
View this thread: http://forums.novell.com/showthread.php?t=452444

Labels (1)
0 Likes
2 Replies
Knowledge Partner
Knowledge Partner

Re: Using regular expression to check text import field size

On 2/20/2012 11:46 AM, matthudson wrote:
>
> Hi,
>
> I'm trying to place size restrictions on a delimited text driver import
> like this:
>
>> if operation attribute 'Description' not-match "{1,10}"

>
> and it's failing miserably.
>
> Ideally I want to stop entries bigger than the schema restrictions and
> generate and veto and a log entry.


Set local variable DESC to op-attr Description

if XPATH true count($DESC>10)
Do something

Anyway, for your Regex, you need a pattern for the {} size to match.

So .{1,10} seems more likely to work. (Leading period).
0 Likes
matthudson Absent Member.
Absent Member.

Re: Using regular expression to check text import field size


Thats brilliant Geoff, thanks!

I've used the .{1,10} method and its working just fine.

Thanks again!


--
matthudson
------------------------------------------------------------------------
matthudson's Profile: http://forums.novell.com/member.php?userid=18744
View this thread: http://forums.novell.com/showthread.php?t=452444

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.