silentwolf
Active member
- Local time
- Today, 03:29
- Joined
- Jun 12, 2009
- Messages
- 644
Sorry for posting so many threats today but need to finish a project of my self today and am a bit stuck at times.
I got this RegEx code from someone here on the forum but not sure who it is right now! Sorry
This function finds all the Mandatnummer in a string of text
Works perfect!
However.
As I need to split different parts of the string providet into other fields I like to do following.
String is something like this
Some text in front whatever Mandatsnummer: V-015043474-20180522 Some Text I would need after this Number REF: 0121452145222
This Text can be several words and even Numbers included however I like the whole Some Text I would need after this Number to be returned in a function.
The above Code Finds all Mandatnummer correctly not sure if I need this to find the Text between Mandatsnummer: xxxxxx and REF:
In the string could be either Mandatsnummer: xxxx and REF: straight afterwards = NO ACTION
or Mandatsnummer:xxxx and Auftraggeberreferenz: = NO ACTION
or Mandatsnummer: xxxx and Zahlungsreferenz: = NO ACTION
Many thanks for help again
I got this RegEx code from someone here on the forum but not sure who it is right now! Sorry
Code:
Public Function ReturnMandatsnummer(strText As String) As String
Dim RegEx As RegExp
Set RegEx = New RegExp
RegEx.Global = True
RegEx.Pattern = "\Mandatsnummer: (\S+)"
Dim mc As MatchCollection
Set mc = RegEx.Execute(strText)
If mc.Count <> 0 Then
Dim Item As Variant
For Each Item In mc
ReturnMandatsnummer = Item
Next Item
End If
End Function
This function finds all the Mandatnummer in a string of text
Works perfect!
However.
As I need to split different parts of the string providet into other fields I like to do following.
String is something like this
Some text in front whatever Mandatsnummer: V-015043474-20180522 Some Text I would need after this Number REF: 0121452145222
This Text can be several words and even Numbers included however I like the whole Some Text I would need after this Number to be returned in a function.
The above Code Finds all Mandatnummer correctly not sure if I need this to find the Text between Mandatsnummer: xxxxxx and REF:
In the string could be either Mandatsnummer: xxxx and REF: straight afterwards = NO ACTION
or Mandatsnummer:xxxx and Auftraggeberreferenz: = NO ACTION
or Mandatsnummer: xxxx and Zahlungsreferenz: = NO ACTION
Many thanks for help again
