Hi,
I have read a bit about the subject and even succeeded in accomplished a few tasks - but I wonder if there is a way to implement the RegExp on 2 different patterns in the same UDF, and if not - what is the shortest way to do so.
Assume A1 holds a string like: ABC(123)*DE#5 6+78_910
(There are 4 spaces between the 5 and the 6)
I want the UDF (with the RegExp object) to return: ABC 123 DE 5 678 910
Explenations:
a) When one of the 2 following characters was met it should be erased.
* +
b) When one of the 4 following characters was met it should be converted into a single space:
# _ ( )
c) Two, or more consecutive spaces should be converted in to a single space.
(Paragraph c can be achieved with TRIM)
To my little knowledge the above (a+b) need 2 different patterns which I was not able to implement.
I thought to nest 2 different UDFs but it seems not professional.
I even thought to add a second argument which, in this case will be 2 and declare 2 different pattern commands and by an IF check to use them Alternately - but I did not succeeded.
The basic UDF (works OK only for paragraph b ) looks like that:
Any help will be appreciated.Please Login or Register to view this content.
Elm
Bookmarks