Dienstag, 30. August 2016

Regular Expression in BBj / Java

declare BBjString test!
test!="HELLO\r\nWORLD\n\rAGAIN"
foo$=test!.replaceAll("\\r\\n|\\n|\\r|"+$0d0a$+"|"+$0d$+"|"+$0a$","<br>")
?foo$

test$="HELLO\r\nWORLD\n\rAGAIN"
test$=cast(BBjString,test$).replaceAll("\\r\\n|\\n|\\r|"+$0d0a$+"|"+$0d$+"|"+$0a$","<br>")
?test$

src! = "ABC___(hellop)_myQuotesAreHere"+$2222$+"12345_ /&%"
ListOfDislikedChars$ ="[\/^\*\$\(\)\&\=\?\'\*\+\-\.\:\,\;\""\%]"; REM [^/....]*/$
firstMatchAtPos=mask(src!,ListOfDislikedChars$) ; ?"pattern matched first at position "+str(firstMatchAtPos)
?src!
des! = src!.replaceAll(ListOfDislikedChars$,java.util.regex.Matcher.quoteReplacement("X"))
?des!

Benefit from the best Windows Desktop app in the world and use Strokey.Net!

Keine Kommentare:

Kommentar veröffentlichen