RegEx string substitution


/ Published in: Perl
Save to your folder(s)

[The original problem was stated as a SQL (SQL Server 2008) problem. This Perl script demonstrates the desired outcome for the problem statement.]

PROBLEM STATEMENT:

Please help me with SQL Query and requirement is as below:

Below is the Data and I have to remove all texts associated with numbers. If incase in between LETTERS if we see number or numbers, those also should be removed, for ex:A2D104380, here A2D should be removed, others only letters.

Field_Name

AS76573

AEDFG103020

A2D104380

S103282

To add to your point.

Yes you are correct but gain if exists number and again followed by any
letters then number also should be removed.

For ex: ASD6D6383884

Here ASD6D should be removed.
GH63737. Here only GH should be removed

SOLUTION RESULTS:

Word 1 = AS76573 -> 76573

Word 2 = AEDFG103020 -> 103020

Word 3 = A2D104380 -> 104380

Word 4 = S103282 -> 103282

Word 5 = ASD6D6383884 -> 6383884

Word 6 = GH63737 -> 63737

Word 7 = AS76573AEDFG103020A2D104380S103282ASD6D6383884GH63737 -> 76573103020104380103282638388463737

URL: http://database.ittoolbox.com/groups/technical-functional/sql-l/sql-query-to-remove-texts-and-numbers-5738855

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.