I want to have a regex with two named caption groups that will catch strings like this :
djhkaisd#@893ian 493089403
jsd%2ckgm* 283482374
ajfioasjf26fa
omioriew
and so, no new lines or white spaces inside the first word but the first part ( name ) can contain any other char ( any char that . represents ), the second part is always a simple number, but it not a must ( with the space before it )
The one i got is :
^(?<name>.+)( (?<number>[0-9]+)){0,1}
or
^(?<name>.+)( (?<number>[0-9]+))?
The problem is that the number
caption group is always empty and the whole string is going inside the name
caption group, for example :
name = asfajsfasd 329042390
number =
i want to have like this :
name = asfajsfasd
number = 329042390
Any ideas how it can be done ?