# Can I use part of Processing source code in my code?

**URL:** https://discourse.processing.org/t/can-i-use-part-of-processing-source-code-in-my-code/4423
**Category:** Project Guidance
**Created:** [October 13, 2018, 11:34am UTC](https://discourse.processing.org/t/can-i-use-part-of-processing-source-code-in-my-code/4423 "2018-10-13T11:34:27Z")
**Posts on this page:** 1
**Showing post:** 12

<div class="post-metadata">

### Author: ![Architector\_4](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/architector_4/32/813_2.png) [@Architector\_4](https://discourse.processing.org/u/Architector_4)
#### Post date: [October 13, 2018, 4:59pm UTC](https://discourse.processing.org/t/can-i-use-part-of-processing-source-code-in-my-code/4423/12 "2018-10-13T16:59:15Z")

</div>

I will not use any regex expression other than what’s possible by PApplet.split(), as I pretty much want to split a path to the file by /, then split last element of that split by .(to get the file’s extension), then replace that last split to “bmp”, and then connect it all back.  
However, by [reading up on regex on Java’s site](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/regex/Pattern.html) I found out that “.” is a regex expression that means any character. I replaced it with “\\.”, with “\\” as an escape sequence for a “\”, and that “\” being an escape sequence for “.” so it wouldn’t match “any character”.

P.S. When writing this comment, for “\\” I had to write “\\\\” to make an escape sequence for this comment to write an escape sequence for Java’s string constant that contains an escape sequence to the regex filter! 😃

---

_[View the full topic](https://discourse.processing.org/t/can-i-use-part-of-processing-source-code-in-my-code/4423)._
