huangyingw
June 9th, 2009, 08:00 AM
Hello, I would like a regulor expression to realize my replace purpose.
origin strings:
\\STBReleases\releases\bj2_brcm_1.6_Builds\bj2_brc m_1.6_1119\ce_sdk_client_nondebug_bcm7405\package\ officialRAG\New\Application_1.6.1119.41.dat
\\STBReleases\releases\new_branch_Builds\new_branc h_1119\ce_sdk_client_nondebug_bcm7405\package\offi cialRAG\New\Application_1.6.1119.41.dat
\\STBReleases\releases\abc-brahcn_Builds\abc-brahcn_1119\ce_sdk_client_nondebug_bcm7405\package \officialRAG\New\Application_1.6.1119.41.dat
The target string I desire.
Take the first line for example:
\\STBReleases\releases\bj2_brcm_1.6_Builds\bj2_brc m_1.6_1119\ce_sdk_client_nondebug_bcm7405\package\ officialRAG\New\Application_1.6.1119.41.dat
My intention is to match out the branch name "bj2_brcm_1.6" before "Builds".And then, I would use the "bj2_brcm_1.6" to find out the number "1119" behind it. And finally replace it with my expecting "myNum". That's all my process.
The final is the target outputs I would like, you see, the branch names migh differ.
\\STBReleases\releases\bj2_brcm_1.6_Builds\bj2_brc m_1.6_myNum\ce_sdk_client_nondebug_bcm7405\package \officialRAG\New\Application_1.6.1119.41.dat
\\STBReleases\releases\new_branch_Builds\new_branc h_myNum\ce_sdk_client_nondebug_bcm7405\package\off icialRAG\New\Application_1.6.1119.41.dat
\\STBReleases\releases\abc-brahcn_Builds\abc-brahcn_myNum\ce_sdk_client_nondebug_bcm7405\packag e\officialRAG\New\Application_1.6.1119.41.dat
origin strings:
\\STBReleases\releases\bj2_brcm_1.6_Builds\bj2_brc m_1.6_1119\ce_sdk_client_nondebug_bcm7405\package\ officialRAG\New\Application_1.6.1119.41.dat
\\STBReleases\releases\new_branch_Builds\new_branc h_1119\ce_sdk_client_nondebug_bcm7405\package\offi cialRAG\New\Application_1.6.1119.41.dat
\\STBReleases\releases\abc-brahcn_Builds\abc-brahcn_1119\ce_sdk_client_nondebug_bcm7405\package \officialRAG\New\Application_1.6.1119.41.dat
The target string I desire.
Take the first line for example:
\\STBReleases\releases\bj2_brcm_1.6_Builds\bj2_brc m_1.6_1119\ce_sdk_client_nondebug_bcm7405\package\ officialRAG\New\Application_1.6.1119.41.dat
My intention is to match out the branch name "bj2_brcm_1.6" before "Builds".And then, I would use the "bj2_brcm_1.6" to find out the number "1119" behind it. And finally replace it with my expecting "myNum". That's all my process.
The final is the target outputs I would like, you see, the branch names migh differ.
\\STBReleases\releases\bj2_brcm_1.6_Builds\bj2_brc m_1.6_myNum\ce_sdk_client_nondebug_bcm7405\package \officialRAG\New\Application_1.6.1119.41.dat
\\STBReleases\releases\new_branch_Builds\new_branc h_myNum\ce_sdk_client_nondebug_bcm7405\package\off icialRAG\New\Application_1.6.1119.41.dat
\\STBReleases\releases\abc-brahcn_Builds\abc-brahcn_myNum\ce_sdk_client_nondebug_bcm7405\packag e\officialRAG\New\Application_1.6.1119.41.dat